set nocompatible " be iMproved, required filetype off " required call plug#begin() Plug 'vim-scripts/c.vim' Plug 'arcticicestudio/nord-vim' Plug 'scrooloose/nerdtree' Plug 'jistr/vim-nerdtree-tabs' Plug 'rhysd/vim-clang-format' Plug 'kana/vim-operator-user' Plug 'rust-lang/rust.vim' "Plug 'Shougo/deoplete.nvim' "Plug 'zchee/deoplete-clang' "Plug 'Shougo/deoplete-clangx' "Plug 'Shougo/neoinclude.vim' "Plug 'roxma/nvim-yarp' "Plug 'sebastianmarkow/deoplete-rust' "Plug 'carlitux/deoplete-flow' Plug 'jpalardy/vim-slime' "Plug 'autozimu/LanguageClient-neovim', { " \ 'branch': 'next', " \ 'do': 'bash install.sh', " \ } Plug 'calviken/vim-gdscript3' "Plug 'Shougo/neosnippet' "Plug 'Shougo/neosnippet-snippets' Plug 'nikvdp/ejs-syntax' Plug 'pangloss/vim-javascript' Plug 'MaxMEllon/vim-jsx-pretty' Plug 'jelera/vim-javascript-syntax' "Plug 'w0rp/ale' Plug 'prettier/prettier' Plug 'flrnprz/plastic.vim' Plug 'rakr/vim-one' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'vim-pandoc/vim-rmarkdown' Plug 'vim-pandoc/vim-pandoc' Plug 'vim-pandoc/vim-pandoc-syntax' Plug 'junegunn/fzf.vim' Plug 'tpope/vim-dadbod' Plug 'lervag/vimtex' Plug 'dpelle/vim-LanguageTool' "Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'tikhomirov/vim-glsl' Plug 'soli/prolog-vim' Plug 'tpope/vim-dispatch' "Plug 'rafcamlet/coc-nvim-lua' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'neovim/nvim-lspconfig' Plug 'hrsh7th/nvim-compe' Plug 'nvim-lua/lsp-status.nvim' "Plug 'evanleck/vim-svelte', {'branch': 'main'} Plug 'leafOfTree/vim-svelte-plugin' Plug 'prettier/vim-prettier', { 'do': 'yarn install' } call plug#end() " required filetype plugin indent on " required let g:prettier#config#tab_width = 2 lua < compe#complete() inoremap compe#confirm('') inoremap compe#close('') inoremap compe#scroll({ 'delta': +4 }) inoremap compe#scroll({ 'delta': -4 }) lua << END local lsp_status = require('lsp-status') lsp_status.register_progress() local lspconfig = require('lspconfig') -- Some arbitrary servers lspconfig.clangd.setup({ handlers = lsp_status.extensions.clangd.setup(), init_options = { clangdFileStatus = true }, on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities }) lspconfig.rust_analyzer.setup({ on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities }) lspconfig.pyright.setup({ on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities }) lspconfig.elmls.setup({ on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities }) lspconfig.svelte.setup({ on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities }) lspconfig.tsserver.setup({ on_attach = lsp_status.on_attach, capabilities = lsp_status.capabilities }) lspconfig.gdscript.setup({ on_attach = function (client) local _notify = client.notify client.notify = function (method, params) if method == 'textDocument/didClose' then -- Godot doesn't implement didClose yet return end _notify(method, params) end lsp_status.on_attach(client) end, capabilities = lsp_status.capabilities, flags = { debounce_text_changes = 150, } }) END " Statusline function! LspStatus() abort let status = luaeval('require("lsp-status").status()') return trim(status) endfunction call airline#parts#define_function('lsp_status', 'LspStatus') call airline#parts#define_condition('lsp_status', 'luaeval("#vim.lsp.buf_get_clients() > 0")') let g:airline#extensions#nvimlsp#enabled = 0 let g:airline_section_x = airline#section#create_right(['lsp_status']) " Errors in Red hi LspDiagnosticsVirtualTextError guifg=red ctermfg=red " Warnings in Yellow hi LspDiagnosticsVirtualTextWarning guifg=yellow ctermfg=yellow " Info and Hints in White hi LspDiagnosticsVirtualTextInformation guifg=white ctermfg=white hi LspDiagnosticsVirtualTextHint guifg=white ctermfg=white " Underline the offending code hi LspDiagnosticsUnderlineError guifg=NONE ctermfg=NONE cterm=underline gui=underline hi LspDiagnosticsUnderlineWarning guifg=NONE ctermfg=NONE cterm=underline gui=underline hi LspDiagnosticsUnderlineInformation guifg=NONE ctermfg=NONE cterm=underline gui=underline hi LspDiagnosticsUnderlineHint guifg=NONE ctermfg=NONE cterm=underline gui=underline lua << EOF vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { -- Enable underline, use default values underline = true, -- Enable virtual text only on Warning or above, override spacing to 2 virtual_text = { spacing = 2, }, } ) EOF autocmd ColorScheme * :lua require('vim.lsp.diagnostic')._define_default_signs_and_highlights() autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics() autocmd FileType matlab setlocal keywordprg=info\ octave\ --vi-keys\ --index-search augroup filetypedetect " Mail autocmd BufRead,BufNewFile *mutt-* setfiletype mail autocmd BufRead,BufNewFile *.gd set filetype=gdscript3 augroup END let g:languagetool_jar = "/home/daan/.local/share/LanguageTool-5.2-SNAPSHOT/languagetool-commandline.jar" let g:jsx_ext_required = 0 let g:neosnippet#enable_completed_snippet = 1 let g:autocomplete_flow#insert_paren_after_function = 0 let g:fzf_buffers_jump = 1 "let g:coc_filetype_map = { "\ 'md': 'tex', "\ } set tags+=./.tags set nobackup set nowritebackup set guifont=Fira\ Code:h12 "Credit joshdick "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux. "If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.) if (empty($TMUX)) if (has("nvim")) "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 > let $NVIM_TUI_ENABLE_TRUE_COLOR=1 endif "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 > if (has("termguicolors")) set termguicolors endif endif let g:airline_powerline_fonts = 1 " Session management set switchbuf=useopen,usetab let g:session = 0 fu! AutoSaveSess() if g:session == 1 call SaveSess() endif endfunction fu! SaveSess() execute 'NERDTreeTabsClose' execute 'mksession! ' . getcwd() . '/.session.vim' let g:session = 1 endfunction fu! RemoveSess() shell "rm " . getcwd() . "/.session.vim" endfunction fu! RestoreSess() if filereadable(getcwd() . '/.session.vim') let initial_args = argv() execute 'so ' . getcwd() . '/.session.vim' for file in initial_args if bufloaded(file) != 1 execute 'tabnew ' . getcwd() . '/' . file else execute 'sb ' . file endif endfor let g:session = 1 endif endfunction :command Savesess call SaveSess() :command Restoresess call RestoreSess() :command Removesess call RemoveSess() nnoremap :Restoresess " Save session on quitting Vim autocmd VimLeave * call AutoSaveSess() " Restore session on starting Vim "autocmd VimEnter * nested call RestoreSess() "---------------------- " move between tabs nnoremap :tabprevious nnoremap :tabnext map :NERDTreeMirrorToggle " prevent mouse vanishing set nomousehide " toggles menu in graphical mode function! ToggleGUICruft() if &guioptions=='ir' exec('set guioptions=imrLn') else exec('set guioptions=ir') endif endfunction map :call ToggleGUICruft() set number set linebreak set nobackup set noswapfile "set shortmess+=I set backspace=indent,eol,start set visualbell t_vb= set showmode "set smartcase nnoremap nnoremap Q nnoremap K runtime! ftplugin/man.vim nnoremap K :Man set mouse=a set nu let g:clang_format#code_style="llvm" set clipboard=unnamed set backspace=indent,eol,start " allow backspacing over everything in insert mode cmap w!! w !sudo tee > /dev/null % set laststatus=2 let g:nord_uniform_diff_background = 1 let g:nord_cursor_line_number_background = 1 "let g:lightline = { "\ 'colorscheme': 'one', "\ } let g:airline_theme='one' set background=dark colorscheme one filetype plugin indent on set smartindent set tabstop=4 set shiftwidth=4 set expandtab :set number relativenumber :set nu rnu :augroup numbertoggle : autocmd! : autocmd BufEnter,FocusGained,InsertLeave * set relativenumber : autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber :augroup END :command WQ wq :command Wq wq :command W w :command Q q :command WQa wqa :command Wqa wqa " Terminal stuff :tnoremap :set ma let g:C_Mapfeader = ',' "let g:coc_snippet_next = '' nnoremap :Files nnoremap :Buffers nnoremap ,s :split nnoremap .s :vsplit nnoremap nnoremap nnoremap nnoremap " Disable arrow keys map map map map imap imap imap imap set completeopt=menuone,noselect