diff options
Diffstat (limited to 'nvim/.config')
| -rw-r--r-- | nvim/.config/nvim/lua/custom/chadrc.lua | 42 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/init.lua | 23 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/plugins/init.lua | 12 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/plugins/lspconfig.lua | 2 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/plugins/override.lua | 5 |
5 files changed, 62 insertions, 22 deletions
diff --git a/nvim/.config/nvim/lua/custom/chadrc.lua b/nvim/.config/nvim/lua/custom/chadrc.lua index 1d3acd3..a5f551d 100644 --- a/nvim/.config/nvim/lua/custom/chadrc.lua +++ b/nvim/.config/nvim/lua/custom/chadrc.lua @@ -7,23 +7,28 @@ local userPlugins = require "custom.plugins" M.plugins = { - options = { - lspconfig = { - setup_lspconf = "custom.plugins.lspconfig", - }, - - statusline = { - separator_style = "round", - }, - }, - - override = { - ["kyazdani42/nvim-tree.lua"] = override.nvimtree, - ["nvim-treesitter/nvim-treesitter"] = override.treesitter, - ["nvim-telescope/telescope.nvim"] = override.telescope, - }, - - user = userPlugins, + options = { + lspconfig = { + setup_lspconf = "custom.plugins.lspconfig", + }, + + statusline = { + separator_style = "round", + }, + }, + + override = { + ["kyazdani42/nvim-tree.lua"] = override.nvimtree, + ["nvim-treesitter/nvim-treesitter"] = override.treesitter, + ["nvim-telescope/telescope.nvim"] = override.telescope, + }, + + -- I forked this repo for my own snippets + remove = { + "rafamadriz/friendly-snippets", + }, + + user = userPlugins, } @@ -31,10 +36,9 @@ M.plugins = { -- example of changing theme: M.ui = { - theme = "onedark", + theme = "onedark", } - M.mappings = require "custom.mappings" return M diff --git a/nvim/.config/nvim/lua/custom/init.lua b/nvim/.config/nvim/lua/custom/init.lua index 457afb0..3af297a 100644 --- a/nvim/.config/nvim/lua/custom/init.lua +++ b/nvim/.config/nvim/lua/custom/init.lua @@ -1,19 +1,32 @@ local opt = vim.opt + + -- Indenting opt.expandtab = false opt.shiftwidth = 4 opt.tabstop = 4 opt.smartindent = true + +vim.g.latex_to_unicode_tab=0 + -- runs a script that cleans out tex build files whenever I close out of a .tex file. vim.cmd("autocmd VimLeave *.tex !texclear %") -- Ensure files are read as what I want: vim.cmd("autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown") vim.cmd("autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff") -vim.cmd("autocmd BufRead,BufNewFile *.tex set filetype=tex") + +-- NvChad uses neovim's filedetector by default (but I force it just in case and posterity) +-- this breaks julia-vim's Unicode support +-- so - revert it back when editing julia file +-- however, I cannot just load julia-vim lazily because devs are even more lazy +vim.g.did_load_filetypes=0 +vim.g.do_filetype_lua=1 vim.cmd("autocmd BufRead,BufNewFile *.jl set filetype=julia") +vim.cmd("autocmd BufRead,BufNewFile *.jl let g:did_load_filetypes=1") +vim.cmd("autocmd BufRead,BufNewFile *.jl let g:do_filetype_lua=0") -- save file as sudo on files that require root permission vim.cmd("cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!") @@ -42,5 +55,13 @@ if &diff endif ]]) +--disable autocommenting on newline +vim.cmd("autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o") + -- autocompile dwmblocks -- vim.cmd("autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks & "}) + +-- needed to load python3, which is needed for latex-live-preview +-- why the hell is this required now??? +vim.g.loaded_python3_provider=1 +vim.g.python3_host_prog="/usr/bin/python3.10" diff --git a/nvim/.config/nvim/lua/custom/plugins/init.lua b/nvim/.config/nvim/lua/custom/plugins/init.lua index c787e64..5d4555b 100644 --- a/nvim/.config/nvim/lua/custom/plugins/init.lua +++ b/nvim/.config/nvim/lua/custom/plugins/init.lua @@ -14,7 +14,12 @@ return { ["JuliaEditorSupport/julia-vim"] = { -- lazy load does not work -- https://github.com/JuliaEditorSupport/julia-vim/issues/269 - -- ft = {"jl"}, + --ft = {"jl"}, + config = function() + vim.g.latex_to_unicode_auto = 1 + -- just in case to avoid interference with tab-completion + vim.g.latex_to_unicode_tab = "off" + end, }, ["christoomey/vim-tmux-navigator"] = { @@ -53,4 +58,9 @@ return { vim.g.vimwiki_list = {{ path = HOME .. '/sync/vimwiki', syntax = 'markdown', ext = '.md' }} end, }, + + ["ivan-boikov/friendly-snippets"] = { + module = "cmp_nvim_lsp", + event = "InsertEnter", + } } diff --git a/nvim/.config/nvim/lua/custom/plugins/lspconfig.lua b/nvim/.config/nvim/lua/custom/plugins/lspconfig.lua index 1b8fa97..77a4b4f 100644 --- a/nvim/.config/nvim/lua/custom/plugins/lspconfig.lua +++ b/nvim/.config/nvim/lua/custom/plugins/lspconfig.lua @@ -4,7 +4,7 @@ M.setup_lsp = function(attach, capabilities) local lspconfig = require "lspconfig" --local servers = { "html", "cssls", "bashls", "emmet_ls", "tsserver", "clangd" } - local servers = { "html", "cssls", "bashls", "clangd", "julials" } + local servers = { "html", "cssls", "bashls", "clangd"} for _, lsp in ipairs(servers) do lspconfig[lsp].setup { diff --git a/nvim/.config/nvim/lua/custom/plugins/override.lua b/nvim/.config/nvim/lua/custom/plugins/override.lua index a42b0d3..3c55585 100644 --- a/nvim/.config/nvim/lua/custom/plugins/override.lua +++ b/nvim/.config/nvim/lua/custom/plugins/override.lua @@ -17,6 +17,9 @@ M.treesitter = { "julia", "latex", }, + highlight = { + enable = true + } } M.nvimtree = { @@ -34,4 +37,6 @@ M.telescope = { }, } + + return M |
