Update editor configs

master
Ian Mancini 3 years ago
parent d4c2ed404c
commit 89ef9a303c

@ -19,13 +19,13 @@
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
(setq doom-font (font-spec :family "{{typography.mono.font}}" :size {{typography.mono.size}}))
(setq doom-font (font-spec :family "Iosevka Nerd Font" :size 14))
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme '{{colors.emacs_colorscheme}})
(setq doom-theme 'doom-one)
(setq doom-themes-treemacs-theme "doom-colors")
;; If you use `org' and don't want your org files in the default location below,
@ -83,6 +83,8 @@
(directory-files-recursively
directory org-agenda-file-regexp))
'("~/.org/work/" "~/.org/projects/" "~/.org/learning/" "~/.org/calendars" "~/.org/conferences/"))))
(setq org-roam-directory (file-truename "~/.org/roam"))
(org-roam-db-autosync-mode)
)
(use-package! org-fancy-priorities
@ -98,36 +100,30 @@
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
(use-package! org-ref
:after org
:config
(setq bibtex-completion-pdf-field 'file)
(defun my/org-ref-open-pdf-at-point ()
"Open the pdf for bibtex key under point if it exists."
(interactive)
(let* ((results (org-ref-get-bibtex-key-and-file))
(key (car results))
(pdf-file (car (bibtex-completion-find-pdf key))))
(if (file-exists-p pdf-file)
(find-file pdf-file) ; original in org-ref-help,
; opens external viewer (org-open-file pdf-file)
(message "No PDF found for %s" key))))
(setq org-ref-open-pdf-function 'find-file)
(setq bibtex-file "~/.org/biblio.bib"
bibtex-completion-bibliography bibtex-file
reftex-default-bibliography bibtex-file
org-ref-default-bibliography (list bibtex-file)
org-ref-completion-library 'org-ref-ivy-cite
org-ref-bibliography-notes "~/.org/biblio-notes.org"
org-ref-pdf-directory "~/.org/biblio-pdfs/")
)
(use-package! org-roam
:after org
:config
(setq org-roam-db-location "/home/ianmethyst/.local/share/emacs/org-roam.db"))
; (use-package! org-ref
; :after org
; :config
; (setq bibtex-completion-pdf-field 'file)
; (defun my/org-ref-open-pdf-at-point ()
; "Open the pdf for bibtex key under point if it exists."
; (interactive)
; (let* ((results (org-ref-get-bibtex-key-and-file))
; (key (car results))
; (pdf-file (car (bibtex-completion-find-pdf key))))
; (if (file-exists-p pdf-file)
; (find-file pdf-file) ; original in org-ref-help,
; ; opens external viewer (org-open-file pdf-file)
; (message "No PDF found for %s" key))))
; (setq org-ref-open-pdf-function 'find-file)
;
; (setq bibtex-file "~/.org/biblio.bib"
; bibtex-completion-bibliography bibtex-file
; reftex-default-bibliography bibtex-file
; org-ref-default-bibliography (list bibtex-file)
; org-ref-completion-library 'org-ref-ivy-cite
; org-ref-bibliography-notes "~/.org/biblio-notes.org"
; org-ref-pdf-directory "~/.org/biblio-pdfs/")
; )
(setq deft-directory "~/.org"
deft-recursive t)
@ -138,7 +134,7 @@
(setq-default delete-by-moving-to-trash t) ; Delete files to trash
(defvar holiday-custom-holidays nil
"Custom holidays")
"Custom holidays.")
(setq holiday-custom-holidays
'((holiday-fixed 1 1 "Año nuevo")
@ -192,3 +188,5 @@
'org-caldav-sync
:after
#'fix-birthdays-timestamps))
(setq +format-with-lsp nil)

@ -23,18 +23,19 @@
(company +childframe) ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
(ivy +fuzzy +prescient) ; a search engine for love and life
;;(ivy +fuzzy +prescient) ; a search engine for love and life
(vertico +icons)
:ui
deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
(emoji +unicode) ; 🙂
fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
@ -55,9 +56,9 @@
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
@ -93,7 +94,7 @@
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
;;lsp
lsp
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
pass ; password manager for nerds
@ -118,7 +119,7 @@
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
@ -136,22 +137,22 @@
;;idris ; a language you can depend on
;;json ; At least it ain't XML
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
(javascript +lsp) ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
(lua +lsp) ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +dragndrop +roam) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
(org +dragndrop +roam2) ; organize your plain life in plain text
(php +lsp) ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
;;python ; beautiful is better than ugly
(python +lsp +pyright +poetry +pyenv) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
@ -161,13 +162,13 @@
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
;;sh ; she sells {ba,z,fi}sh shells on the C xor
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
;;yaml ; JSON, but readable
web ; the tubes
yaml ; JSON, but readable
;;zig ; C, but simpler
:email

@ -56,7 +56,6 @@
(package! org-fancy-priorities)
(package! org-ref)
(package! org-caldav)
(package! org-roam-server)
(package! nyan-mode)

@ -5,7 +5,7 @@ command -v vim >/dev/null && alias vi="vi" vim="vim" vimdiff="vimdiff"
command -v nvim >/dev/null && alias vi="nvim" vim="nvim" vimdiff="nvim -d"
# neovim-remote
nvr_command="nvr -cc split --remote-wait +'set bufhidden=wipe'"
nvr_command="nvr --remote-wait +'set bufhidden=wipe'"
command -v nvr >/dev/null && alias vi="$nvr_command" vim="$nvr_command"
# Verbose

@ -1,7 +1,10 @@
local prettier = function()
return {
exe = "prettier",
args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0), '--single-quote', '--no-semi'},
args = {
"--stdin-filepath", vim.api.nvim_buf_get_name(0), '--single-quote',
'--no-semi'
},
stdin = true
}
end
@ -14,20 +17,59 @@ local black = function()
}
end
local clang_format = function()
return {
exe = "clang-format",
args = {"--assume-filename", vim.api.nvim_buf_get_name(0)},
stdin = true,
cwd = vim.fn.expand('%:p:h')
}
end
local gofmt = function()
return {
exe = "gofmt",
stdin = true
}
end
local blade_formatter = function()
return {
exe = "blade-formatter",
args = {"--stdin"},
stdin = true
}
end
local lua_formatter = function()
return {
exe = "lua-format",
stdin = true
}
end
require('formatter').setup({
logging = false,
filetype = {
c = {clang_format},
blade = {blade_formatter},
go = {gofmt},
cpp = {clang_format},
javascript = {prettier},
javascriptreact = {prettier},
typescript = {prettier},
typescriptreact = {prettier},
python = {black}
php = {prettier},
css = {prettier},
html = {prettier},
python = {black},
lua = {lua_formatter}
}
})
vim.api.nvim_exec([[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.js,*.ts,*.jsx,*.tsx,*.py FormatWrite
autocmd BufWritePost *.c,*.h,*.cpp,*.go,*.html,*.css,*.js,*.ts,*.jsx,*.tsx,*.py,*.blade.php,*.php,*.lua FormatWrite
augroup END
]], true)

@ -1,22 +1,22 @@
---@diagnostic disable: undefined-global
return require('packer').startup(function()
use 'wbthomason/packer.nvim'
use {'ibhagwan/fzf-lua',
-- Fuzzy finder
use {
'ibhagwan/fzf-lua',
requires = {
'vijaymarupudi/nvim-fzf',
'kyazdani42/nvim-web-devicons' -- optional for icons
'vijaymarupudi/nvim-fzf', 'kyazdani42/nvim-web-devicons' -- optional for icons
},
config = [[require('plugins.fzf-lua')]]
}
-- File explorer
use {
'kevinhwang91/rnvimr',
config = [[require('plugins.rnvimr')]]
}
-- File explorer
use {
'kyazdani42/nvim-tree.lua',
config = [[require('plugins.nvim-tree')]]
@ -29,19 +29,21 @@ return require('packer').startup(function()
}
-- Langugage specific LSP plugins
use { 'tjdevries/nlua.nvim' }
use {'tjdevries/nlua.nvim'}
use {'jose-elias-alvarez/nvim-lsp-ts-utils'}
-- Additional LSP plugins
use {
'glepnir/lspsaga.nvim',
'tami5/lspsaga.nvim',
commit = '373bc031b39730cbfe492533c3acfac36007899a',
config = [[require('plugins.lspsaga-nvim')]]
}
use { 'folke/lsp-colors.nvim' }
use {'folke/lsp-colors.nvim'}
-- Outline (LSP)
-- use { 'simrat39/symbols-outline.nvim' }
use { 'stevearc/aerial.nvim' }
use {'stevearc/aerial.nvim'}
-- Diagnostics
use {
@ -73,8 +75,8 @@ return require('packer').startup(function()
}
-- Snippets
use { 'hrsh7th/vim-vsnip' }
use { 'hrsh7th/vim-vsnip-integ' }
use {'hrsh7th/vim-vsnip'}
use {'hrsh7th/vim-vsnip-integ'}
-- Terminal
use {
@ -85,10 +87,10 @@ return require('packer').startup(function()
-- Git
use {
'lewis6991/gitsigns.nvim',
requires = { 'nvim-lua/plenary.nvim' },
requires = {'nvim-lua/plenary.nvim'},
config = [[require('plugins.gitsigns-nvim')]]
}
use { 'tpope/vim-fugitive' }
use {'tpope/vim-fugitive'}
use {
'kdheepak/lazygit.nvim',
config = [[require('plugins.lazygit-nvim')]]
@ -101,9 +103,12 @@ return require('packer').startup(function()
}
-- Handy stuff
use { 'ygm2/rooter.nvim' }
use { 'dhruvasagar/vim-table-mode' }
use { 'tpope/vim-eunuch' }
use {
'ygm2/rooter.nvim',
config = function() vim.g.outermost_root = false end
}
use {'dhruvasagar/vim-table-mode'}
use {'tpope/vim-eunuch'}
-- Statusline
-- use {
@ -113,25 +118,28 @@ return require('packer').startup(function()
use {
'hoob3rt/lualine.nvim',
requires = {'kyazdani42/nvim-web-devicons', opt = true},
requires = {
'kyazdani42/nvim-web-devicons',
opt = true
},
config = [[require('plugins.lualine')]]
}
-- Syntax plugins
use { 'euclidianAce/BetterLua.vim' }
use {'euclidianAce/BetterLua.vim'}
-- Color highlighting
use { 'norcalli/nvim-colorizer.lua' }
use {'norcalli/nvim-colorizer.lua'}
-- Colorschemes
use {
'Th3Whit3Wolf/onebuddy',
requires = { {'tjdevries/colorbuddy.vim'} }
requires = {'tjdevries/colorbuddy.vim'}
}
use { 'RRethy/nvim-base16' }
use { 'NTBBloodbath/doom-one.nvim' }
use { 'folke/tokyonight.nvim' }
use { 'marko-cerovac/material.nvim' }
use {'RRethy/nvim-base16'}
use {'NTBBloodbath/doom-one.nvim'}
use {'folke/tokyonight.nvim'}
use {'marko-cerovac/material.nvim'}
-- Cursorline
-- use { 'xiyaowong/nvim-cursorword' }
@ -147,5 +155,7 @@ return require('packer').startup(function()
'petobens/poet-v',
config = [[require('plugins.poet-v')]]
}
end)
-- Blade
use {'Eduruiz/vim-blade'}
end)

@ -1,16 +1,19 @@
local lsp = require("lspconfig")
local aerial = require("aerial")
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
vim.lsp.handlers["textDocument/publishDiagnostics"] =
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
signs = true,
virtual_text = true,
underline = true
})
})
local noremap = function(lhs, rhs, mode)
mode = mode or 'n'
local opts = { noremap=true, silent=true }
local opts = {
noremap = true,
silent = true
}
vim.api.nvim_buf_set_keymap(0, mode, lhs, rhs, opts)
end
@ -39,7 +42,7 @@ local set_lsp_config = function(client, bufnr)
[']e'] = '<cmd>Lspsaga diagnostic_jump_prev<CR>',
['<leader>co'] = '<cmd>AerialToggle!<CR>',
['[['] = '<cmd>AerialPrevUp<CR>',
[']]'] = '<cmd>AerialNext<CR>',
[']]'] = '<cmd>AerialNext<CR>'
}
}
@ -50,12 +53,26 @@ local set_lsp_config = function(client, bufnr)
end
end
-- Lua
require('nlua.lsp.nvim').setup(lsp, {
on_attach = set_lsp_config,
on_attach = set_lsp_config
})
-- C/C++
lsp.clangd.setup {
on_attach = set_lsp_config
}
-- Golang
lsp.gopls.setup {
on_attach = set_lsp_config
}
-- PHP
lsp.phpactor.setup {
on_attach = set_lsp_config
}
-- Typescript
lsp.tsserver.setup {
on_attach = function(client, bufnr)
@ -65,48 +82,9 @@ lsp.tsserver.setup {
}
-- Python
lsp.pyright.setup{
lsp.pyright.setup {
on_attach = set_lsp_config
}
-- lsp.pyls.setup{
-- on_attach = set_lsp_config,
-- settings = {
-- pyls = {
-- plugins = {
-- jedi_completion = {enabled = false},
-- jedi_definition = {enabled = false},
-- yapf = {enabled = false},
-- rope_completion = {enabled = false},
-- pylint = {enabled = false},
-- pyflakes = {enabled = false},
-- pydocstyle = {enabled = false},
-- preload = {enabled = false},
-- mccabe = {enabled = false},
-- jedi_symbols = {enabled = false},
-- jedi_references = {enabled = false},
-- }}}}
-- EFM
-- local function eslint_config_exists()
-- local eslintrc = vim.fn.glob(".eslintrc*", 0, 1)
--
-- if not vim.tbl_isempty(eslintrc) then
-- return true
-- end
--
-- if vim.fn.filereadable("package.json") then
-- if vim.fn.json_decode(vim.fn.readfile("package.json"))["eslintConfig"] then
-- return true
-- end
-- end
--
-- return false
-- end
}
local eslint = {
lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}",
@ -125,31 +103,37 @@ local flake8 = {
local isort = {
formatCommand = "isort --profile black -",
formatStdin = true,
formatStdin = true
}
local phpstan = {
lintCommand = "./vendor/bin/phpstan analyze --error-format raw --no-progress"
}
lsp.efm.setup {
init_options = {
hover = true,
documentSymbol = true,
codeAction = true,
completion = true,
documentFormatting = true
},
filetypes = {"javascript", "typescript", "javascriptreact", "typescriptreact", "python" },
on_attach = function(client, bufnr)
set_lsp_config(client, bufnr)
end,
root_dir = function()
-- if not eslint_config_exists() then
-- return nil
-- end
return vim.fn.getcwd()
end,
filetypes = {
"javascript", "typescript", "javascriptreact", "typescriptreact",
"python", "php", "blade"
},
on_attach = function(client, bufnr) set_lsp_config(client, bufnr) end,
root_dir = function() return vim.fn.getcwd() end,
settings = {
rootMarkers = {".eslintrc", ".eslintrc.js", ".git/", "pyproject.toml" },
rootMarkers = {".eslintrc", ".eslintrc.js", ".git/", "pyproject.toml"},
languages = {
javascript = {eslint},
javascriptreact = {eslint},
typescript = {eslint},
typescriptreact = {eslint},
python = {flake8, isort}
python = {flake8, isort},
php = {phpstan},
blade = {phpstan}
}
}
}

@ -1,6 +1,4 @@
local utils = require('utils')
require("toggleterm").setup{
require("toggleterm").setup {
open_mapping = [[<a-`>]],
hide_numbers = true,
shade_terminals = true,
@ -10,12 +8,15 @@ require("toggleterm").setup{
close_on_exit = false,
float_opts = {
winblend = 0,
border = 'single',
border = 'single'
}
}
function _G.set_terminal_keymaps()
utils.map('t', '<esc>', [[<C-\><C-n>]])
local opts = {
noremap = true
}
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
end
vim.cmd('autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()')
vim.cmd('autocmd! TermOpen term://(*toggleterm#* lua set_terminal_keymaps()')

@ -3,15 +3,13 @@ utils.map('n', '<leader>op', '<cmd>NvimTreeToggle<CR>')
vim.g.nvim_tree_special_files = {}
vim.g.nvim_tree_git_hl = 1
vim.g.nvim_tree_follow = 1
vim.g.nvim_tree_show_icons = {
git = 0,
folders = 1,
files = 1,
folder_arrows = 1,
folder_arrows = 1
}
vim.g.nvim_tree_icons = {
default = '',
git = {
@ -22,12 +20,43 @@ vim.g.nvim_tree_icons = {
untracked = '',
deleted = '',
ignored = ""
}
}
require'nvim-tree'.setup {
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = {},
update_to_buf_dir = {
enable = true,
auto_open = true
},
auto_close = false,
open_on_tab = false,
hijack_cursor = false,
update_cwd = false,
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {}
},
system_open = {
cmd = nil,
args = {}
},
view = {
width = 30,
height = 30,
side = 'left',
auto_resize = false,
mappings = {
custom_only = false,
list = {}
}
}
}
vim.api.nvim_exec(
[[
au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif
]],
false
)
vim.api.nvim_exec([[
au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif
]], false)

@ -1,2 +1,2 @@
vim.g.highlight_whitespace = 0
vim.g.strip_whitespace_on_save = 1
vim.g.strip_whitespace_on_save = 0

@ -22,7 +22,7 @@ done
if [ -d "$HOME/.dotfiles" ]; then
cd "$HOME/.dotfiles"
for dir in $(find . -maxdepth 1 -type d -printf "%f\n" | grep -v '\.'); do
stow -D -d "$HOME/.dotfiles" -t "$HOME" "$dir" &> /dev/null
stow -D -d "$HOME/.dotfiles" -t "$HOME" "$dir" &> /dev/null || true
done
cd $OLDIR

Loading…
Cancel
Save