diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2022-11-27 17:22:55 +0100 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2022-11-27 17:22:55 +0100 |
| commit | fa44b597d9272e06144c3e9d1acb273a6f1e89ab (patch) | |
| tree | c760bb28fcfd1e59bb5cb32780995e3db7d804be /nvim/.config | |
| parent | e949ec7a6a07a884d99e1ec4ccb7a5d7d683eeaf (diff) | |
Got rid of NvChad childish idiocy, init.vim all the way!
slock instead of i3lock + removed related icons
added startxautolock
copied pass-git-helper
automatic startx
Diffstat (limited to 'nvim/.config')
| -rw-r--r-- | nvim/.config/nvim/init.vim | 414 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/chadrc.lua | 44 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/init.lua | 67 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/mappings.lua | 54 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/plugins/init.lua | 66 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/plugins/lspconfig.lua | 33 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/custom/plugins/override.lua | 42 |
7 files changed, 414 insertions, 306 deletions
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim new file mode 100644 index 0000000..73637c5 --- /dev/null +++ b/nvim/.config/nvim/init.vim @@ -0,0 +1,414 @@ +let MINPAC_DIR = "~/.config/nvim/pack/minpac/opt/minpac/" +if empty(glob(MINPAC_DIR . "/autoload/minpac.vim")) + call system("mkdir -p " . MINPAC_DIR . "&& git clone https://github.com/k-takata/minpac.git " . MINPAC_DIR) + " packadd minpac + " call minpac#init() + " call minpac#add('k-takata/minpac', {'type': 'opt'}) + " call minpac#update() + echo 'minpac installed, restart nvim' + finish +endif + +packadd minpac +call minpac#init() + +command! PackUpdate packadd minpac | source $MYVIMRC | redraw | call minpac#update() +command! PackClean packadd minpac | source $MYVIMRC | call minpac#clean() + +let mapleader = " " + +call minpac#add('k-takata/minpac', {'type': 'opt'}) + +" general improvements +call minpac#add('lukas-reineke/indent-blankline.nvim') +call minpac#add('tpope/vim-characterize') " improvements to <ga> +call minpac#add('tpope/vim-commentary') " comment out: <gc> selection, <gcc> line +call minpac#add('tpope/vim-eunuch') " UNIX stuff: :Wall, :Delete, :Remove +call minpac#add('tpope/vim-sleuth') " autodetect shiftwidth +call minpac#add('tpope/vim-surround') " <cs"'> inside "Hello" changes to 'Hello' +call minpac#add('nelstrom/vim-visual-star-search') " visual select + <*> = find selected +call minpac#add('godlygeek/tabular') " :Tabularize /,/r0 = align by , and align right +call minpac#add('luukvbaal/nnn.nvim') +call minpac#add('folke/which-key.nvim') +call minpac#add('roblillack/vim-bufferlist') + +" theming +call minpac#add('joshdick/onedark.vim') +call minpac#add('itchyny/lightline.vim') + +" dev +call minpac#add('jpalardy/vim-slime') +call minpac#add('JuliaEditorSupport/julia-vim') +call minpac#add('christoomey/vim-tmux-navigator') +call minpac#add('neovim/nvim-lspconfig') +call minpac#add('nvim-treesitter/nvim-treesitter') +"call minpac#add('Issafalcon/lsp-overloads.nvim') +call minpac#add('kyazdani42/nvim-web-devicons') +call minpac#add('folke/trouble.nvim') +call minpac#add('hrsh7th/cmp-nvim-lsp') +call minpac#add('hrsh7th/cmp-nvim-lsp-document-symbol') +call minpac#add('hrsh7th/cmp-nvim-lsp-signature-help') +call minpac#add('amarakon/nvim-cmp-buffer-lines') + + +" snippets +call minpac#add('hrsh7th/nvim-cmp') +call minpac#add('hrsh7th/cmp-buffer') +call minpac#add('hrsh7th/cmp-path') +call minpac#add('hrsh7th/cmp-cmdline') +call minpac#add('hrsh7th/cmp-nvim-lua') +call minpac#add('L3MON4D3/LuaSnip') +call minpac#add('saadparwaiz1/cmp_luasnip') +call minpac#add('ivan-boikov/friendly-snippets') + +call minpac#add('lervag/vimtex') +call minpac#add('vimwiki/vimwiki') + +"call minpac#add('') + +if empty(glob("~/.config/nvim/pack/minpac/start/friendly-snippets")) + call minpac#update() + echo "Wait for packages to install, then restart nvim one last time" + finish +endif + + + +lua << EOF + require("which-key").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } +EOF + +map <silent> <C-b> :call BufferList()<CR> + + +set background=dark +set termguicolors +colorscheme onedark +let g:lightline = { + \ 'colorscheme': 'onedark', + \ } + +" Indenting +set expandtab +set shiftwidth=4 +set tabstop=4 +set smartindent + +nmap <Ctrl-Tab> :bnext<CR> + + + + +let g:latex_to_unicode_keymap = 1 +"let g:latex_to_unicode_tab=1 +let g:latex_to_unicode_file_types = ".*" + +" runs a script that cleans out tex build files whenever I close out of a .tex file. +autocmd VimLeave *.tex !texclear % + +" Filetype detection +set filetype +" Ensure files are read as what I want: +"autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown +"autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff + +"autocmd BufRead,BufNewFile *.jl set filetype=julia +"autocmd BufRead,BufNewFile *.jl let g:did_load_filetypes=1 +"autocmd BufRead,BufNewFile *.jl let g:do_filetype_lua=0 + +" save file as sudo on files that require root permission +cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! + +" automatically delete all trailing whitespace and newlines at end of file on save +fun! TrimWhitespace() + let l:save = winsaveview() + keeppatterns %s/\s\+$//e + call winrestview(l:save) +endfun +fun! TrimTrailingLines() + let l:save = winsaveview() + keeppatterns :v/\_s*\S/d + call winrestview(l:save) +endfun +autocmd BufWritePre * call TrimWhitespace() +autocmd BufWritePre * call TrimTrailingLines() + + +" turn off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable +if &diff + highlight! link DiffText MatchParen +endif + +" disable autocommenting on newline +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 & "}) + +" join vim's and system's clipboards +" unnamed is X11's PRIMARY register, unnamedplus is CLIPBOARD +set clipboard=unnamedplus + +" mappings +" search and replace +nnoremap S :%s//g<Left><Left> +" check file in shellcheck +nmap <leader>s :!clear && shellcheck -x %<CR> +" -- open bibliography file in split +nmap <leader>b :vsp<space>$BIB<CR> +nmap <leader>r :vsp<space>$REFER<CR> +" compile document, be it groff/LaTeX/markdown/etc. +"nmap <leader>lc :w! | !compile '<c-r>%'<CR> +" open corresponding .pdf/.html or preview +"nmap <leader>lp :!opout <c-r>%<CR> +" C/C++ dev +nmap <F5> :make run<CR> +nmap <F7> :make<CR> + + +vmap <C-c><C-c> :SlimeRegionSend +nmap <C-c><C-c> :SlimeParagraphSend +let g:slime_paste_file = $XDG_CACHE_HOME + "/slime_paste" +let g:slime_target = "tmux" +let g:slime_default_config = { "socket_name" : "default", "target_pane" : "{last}" } +let g:slime_cell_delimiter = "\n" + + +nmap <C-l> :TmuxNavigateRight<CR> + + +lua << EOF +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = {{ + "c", "lua", "cpp", "bash", "python", + "git_rebase", "gitattributes", "gitcommit", --"gitignore", + "make", "regex", "vim", + "html", "css", "javascript", "json", "yaml", "markdown"}}, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = false, + + -- List of parsers to ignore installing (for "all") + ignore_install = { "latex", "julia" }, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- the name of the parser) + -- list of language that will be disabled + disable = { "latex", "julia" }, + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} +EOF + + +lua << EOF + require'lspconfig'.julials.setup{} +EOF +nmap <leader>ld :lua vim.lsp.buf.declaration()<CR> +nmap <leader><leader> :lua vim.lsp.buf.hover()<CR> +nmap <leader>ll :lua vim.lsp.util.show_line_diagnostics()<CR> +nmap <leader>lk :lua vim.lsp.buf.signature_help()<CR> +nmap <leader>lr :lua vim.lsp.buf.references()<CR> + +let g:latex_to_unicode_auto = 1 +" just in case to avoid interference with tab-completion +let g:latex_to_unicode_tab = "off" + +let g:vimtex_view_method = "zathura" +let g:vimtex_compiler_method = 'latexmk' + +let g:vimwiki_ext2syntax = { '.Rmd': 'markdown', '.rmd': 'markdown', '.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown' } +" require("custom.plugins.mappings").vimwiki() +" local map = require("core.utils").map +nmap <leader>ww :VimwikiIndex<CR> +"local HOME = os.getenv("HOME") +let g:vimwiki_list = [{ 'path' : '~/sync/vimwiki', 'syntax' : 'markdown', 'ext' : '.md' }] + + + + + + + + + +set completeopt=menu,menuone,noselect + +lua <<EOF + local luasnip = require("luasnip") + local cmp = require("cmp") + + local has_words_before = function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + end, + }, + + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + + mapping = cmp.mapping.preset.insert({ + ['<C-p>'] = cmp.mapping.select_prev_item(), + ['<C-n>'] = cmp.mapping.select_next_item(), + ['<C-Space>'] = cmp.mapping.complete(), + ['<C-e>'] = cmp.mapping.abort(), + -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ['<CR>'] = cmp.mapping.confirm({ select = true }), + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + + sources = cmp.config.sources({ + { name = 'nvim_lsp_signature_help' }, + { name = 'buffer-lines' }, + { name = 'nvim_lsp' }, + -- { name = 'vsnip' }, -- For vsnip users. + { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users + }, + {{ name = 'buffer' } + }) + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'nvim_lsp_document_symbol' }, + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources( + {{ name = 'path' }}, + {{ name = 'cmdline' }} + ) + }) + + -- Set up lspconfig. + local capabilities = require('cmp_nvim_lsp').default_capabilities() + require('lspconfig')['clangd'].setup { + capabilities = capabilities + } + require('lspconfig')['cmake'].setup { + capabilities = capabilities + } + require('lspconfig')['julials'].setup { + capabilities = capabilities + } + + require'cmp'.setup { + sources = { + { name = "luasnip" }, + { name = "nvim_lsp" }, + { name = "buffer" }, + { name = "nvim_lua" }, + { name = "path" }, + }, + } + require("luasnip.loaders.from_vscode").lazy_load() +EOF + + + +" nnn browser integration +lua << EOF + require("nnn").setup() +EOF +nmap <C-n> :NnnPicker<CR> + + + + +let g:julia_blocks = 0 +let g:julia_indent_align_import = 0 +let g:julia_indent_align_brackets = 0 +let g:julia_indent_align_funcargs = 0 +let g:julia_set_indentation = 0 + +hi link juliaComma Comment +hi link juliaParDelim Comment +hi link juliaSemicolon Comment +hi link juliaFunctionCall Function + + +lua << EOF +require("trouble").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below +} +EOF diff --git a/nvim/.config/nvim/lua/custom/chadrc.lua b/nvim/.config/nvim/lua/custom/chadrc.lua deleted file mode 100644 index a5f551d..0000000 --- a/nvim/.config/nvim/lua/custom/chadrc.lua +++ /dev/null @@ -1,44 +0,0 @@ --- This is an example chadrc file , its supposed to be placed in /lua/custom/ - -local M = {} - -local override = require "custom.plugins.override" -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, - }, - - -- I forked this repo for my own snippets - remove = { - "rafamadriz/friendly-snippets", - }, - - user = userPlugins, -} - - --- make sure you maintain the structure of `core/default_config.lua` here, --- example of changing theme: - -M.ui = { - 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 deleted file mode 100644 index 3af297a..0000000 --- a/nvim/.config/nvim/lua/custom/init.lua +++ /dev/null @@ -1,67 +0,0 @@ -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") - --- 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!") - --- automatically delete all trailing whitespace and newlines at end of file on save -vim.cmd([[ -fun! TrimWhitespace() - let l:save = winsaveview() - keeppatterns %s/\s\+$//e - call winrestview(l:save) -endfun -fun! TrimTrailingLines() - let l:save = winsaveview() - keeppatterns :v/\_s*\S/d - call winrestview(l:save) -endfun -autocmd BufWritePre * call TrimWhitespace() -autocmd BufWritePre * call TrimTrailingLines() -]]) - - --- turn off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable -vim.cmd([[ -if &diff - highlight! link DiffText MatchParen -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/mappings.lua b/nvim/.config/nvim/lua/custom/mappings.lua deleted file mode 100644 index 4d9c4f9..0000000 --- a/nvim/.config/nvim/lua/custom/mappings.lua +++ /dev/null @@ -1,54 +0,0 @@ -local M = {} - -M.general = { - n = { - -- check file in shellcheck - ["<leader>s"] = {":!clear && shellcheck -x %<CR>", ""}, - -- open bibliography file in split - ["<leader>b"] = {":vsp<space>$BIB<CR>", ""}, - ["<leader>r"] = {":vsp<space>$REFER<CR>", ""}, - -- compile document, be it groff/LaTeX/markdown/etc. - ["<leader>lc"] = {":w! | !compile '<c-r>%'<CR>", ""}, - -- open corresponding .pdf/.html or preview - ["<leader>lp"] = {":!opout <c-r>%<CR><CR>", ""}, - ["<leader>pc"] = {":PackerCompile <CR>", ""}, - ["<F5>"] = {":make run<CR>", ""}, - ["<F7>"] = {":make<CR>", ""}, - --[""] = {"", ""}, - } -} - -M.vim_latex_live_preview = { - n = { - ["<F5>"] = {":LLPStartPreview<CR>", ""}, - }, -} - -M.vim_slime = { - v = { - ["<C-c><C-c>"] = {"<Plug>SlimeRegionSend", ""}, - }, - n = { - ["<C-c><C-c>"] = {"<Plug>SlimeParagraphSend", ""}, - ["<C-c>v"] = {"<Plug>SlimeConfig", ""}, - } -} - -M.vim_tmux_navigator = { - n = { - ["<C-l>"] = {":TmuxNavigateRight<CR>", ""}, - }, -} - ---M.vimwiki = { --- n = { --- ["<leader>wf"] = {"<cmd> VimwikiIndex <CR>", ""}, --- } ---} - --- replace all is aliased to S. --- vimscript prints immediately that I entered search-replace mode, lua does not --- map("n", "S", ":%s//g<Left><Left>") -vim.cmd("nnoremap S :%s//g<Left><Left>") - -return M diff --git a/nvim/.config/nvim/lua/custom/plugins/init.lua b/nvim/.config/nvim/lua/custom/plugins/init.lua deleted file mode 100644 index 5d4555b..0000000 --- a/nvim/.config/nvim/lua/custom/plugins/init.lua +++ /dev/null @@ -1,66 +0,0 @@ -return { - - ["jpalardy/vim-slime"] = { - --ft = {"jl", "py", "m"}, - config = function() - vim.g.slime_paste_file = "$HOME/.cache/slime_paste" - vim.g.slime_target = "tmux" - vim.g.slime_default_config = { socket_name = "default", target_pane = "{last}" } - vim.g.slime_cell_delimiter = "\n" - --require("custom.mappings").vim_slime() - end, - }, - - ["JuliaEditorSupport/julia-vim"] = { - -- lazy load does not work - -- https://github.com/JuliaEditorSupport/julia-vim/issues/269 - --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"] = { - --ft = {"jl", "py", "m"}, - config = function() - --require("custom.mappings").vim_tmux_navigator() - end, - }, - - --["lervag/vimtex"] = { - -- ft = {"tex"}, - -- setup = function() - -- -- possibly move out of lazy load - -- vim.g.vimtex_view_method = "zathura" - -- end, - --}, - - ["xuhdev/vim-latex-live-preview"] = { - ft = {"tex"}, - config = function() - print("latex-preview config") - vim.g.livepreview_use_biber = 1 - vim.g.livepreview_cursorhold_recompile = 1 - vim.opt.updatetime = 1000 - --require("custom.mappings").vim_latex_live_preview() - end, - }, - - ["vimwiki/vimwiki"] = { - config = function() - vim.g.vimwiki_ext2syntax = { ['.Rmd']='markdown', ['.rmd']='markdown', ['.md']='markdown', ['.markdown']='markdown', ['.mdown']='markdown' } - --require("custom.plugins.mappings").vimwiki() - --local map = require("core.utils").map - --map("n", "<leader>ww", ':VimwikiIndex') - local HOME = os.getenv("HOME") - 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 deleted file mode 100644 index 77a4b4f..0000000 --- a/nvim/.config/nvim/lua/custom/plugins/lspconfig.lua +++ /dev/null @@ -1,33 +0,0 @@ -local M = {} - -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"} - - for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - on_attach = attach, - capabilities = capabilities, - root_dir = vim.loop.cwd, - } - end - - -- temporarily disable tsserver suggestions - require("lspconfig").tsserver.setup { - init_options = { - preferences = { - disableSuggestions = true, - }, - }, - - on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>fm", "<cmd>lua vim.lsp.buf.formatting()<CR>", {}) - end, - } - -end - -return M diff --git a/nvim/.config/nvim/lua/custom/plugins/override.lua b/nvim/.config/nvim/lua/custom/plugins/override.lua deleted file mode 100644 index 3c55585..0000000 --- a/nvim/.config/nvim/lua/custom/plugins/override.lua +++ /dev/null @@ -1,42 +0,0 @@ --- overriding default plugin configs! - -local M = {} - -M.treesitter = { - ensure_installed = { - "vim", - "html", - "css", - "javascript", - "json", - "markdown", - "c", - "cpp", - "bash", - "lua", - "julia", - "latex", - }, - highlight = { - enable = true - } -} - -M.nvimtree = { - git = { - enable = true, - }, -} - -M.telescope = { - extensions = { - -- fd is needed - media_files = { - filetypes = { "png", "webp", "jpg", "jpeg" }, - }, - }, -} - - - -return M |
