From d07f8f78e15751f695598692ce6285a886555c68 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 29 Apr 2022 21:56:19 +0200 Subject: [PATCH] Updates --- after/plugin/plugin_settings.vim | 33 ++++++ ale_linters/haskell/argon.vim | 69 ------------ plugin/keys.vim | 102 +++++++++++++----- plugins.toml | 179 +++++++++++++++++++++++++++---- vimrc | 34 +++++- 5 files changed, 295 insertions(+), 122 deletions(-) delete mode 100644 ale_linters/haskell/argon.vim diff --git a/after/plugin/plugin_settings.vim b/after/plugin/plugin_settings.vim index e69de29..5acc31f 100644 --- a/after/plugin/plugin_settings.vim +++ b/after/plugin/plugin_settings.vim @@ -0,0 +1,33 @@ +if has('nvim') +lua << EOF + vim.diagnostic.config({ + virtual_text = false, + signs = true, + underline = true, + update_in_insert = false, + severity_sort = false, + }) + +vim.cmd('autocmd CursorHold * lua vim.diagnostic.open_float()') +vim.o.updatetime = 300 + +-- Show all diagnostics on current line in floating window +--vim.api.nvim_set_keymap( +-- 'n', 'd', ':lua vim.diagnostic.open_float()', +-- { noremap = true, silent = true } +--) +-- Go to next diagnostic (if there are multiple on the same line, only shows +-- one at a time in the floating window) +--vim.api.nvim_set_keymap( +-- 'n', 'n', ':lua vim.diagnostic.goto_next()', +-- { noremap = true, silent = true } +--) +-- Go to prev diagnostic (if there are multiple on the same line, only shows +-- one at a time in the floating window) +--vim.api.nvim_set_keymap( +-- 'n', 'p', ':lua vim.diagnostic.goto_prev()', +-- { noremap = true, silent = true } +--) + +EOF +endif diff --git a/ale_linters/haskell/argon.vim b/ale_linters/haskell/argon.vim deleted file mode 100644 index 2a3e425..0000000 --- a/ale_linters/haskell/argon.vim +++ /dev/null @@ -1,69 +0,0 @@ -" Author: Julian Ospald -" Description: argon for Haskell files - -call ale#Set('haskell_argon_executable', 'argon') -call ale#Set('haskell_argon_options', '') -call ale#Set('haskell_argon_error_level', 12) -call ale#Set('haskell_argon_warn_level', 8) -call ale#Set('haskell_argon_info_level', 4) - - -function! ale_linters#haskell#argon#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'haskell_argon_executable') -endfunction - - -function! ale_linters#haskell#argon#GetCommand(buffer) abort - return ale#Escape(ale_linters#haskell#argon#GetExecutable(a:buffer)) - \ . ' ' - \ . ale#Var(a:buffer, 'haskell_argon_options') - \ . ' -m ' . ale#Var(a:buffer, 'haskell_argon_info_level') - \ . ' -j' - \ . ' %t' -endfunction - - -function! ale_linters#haskell#argon#Handle(buffer, lines) abort - let l:output = [] - - for l:error in ale#util#FuzzyJSONDecode(a:lines, []) - if !has_key(l:error, 'blocks') - " this cannot be formatted properly into an ALE error - execute 'echom ''[argon] '' l:error.message' - return l:output - endif - for l:block in l:error.blocks - let l:complexity = l:block.complexity - - if l:complexity >= ale#Var(a:buffer, 'haskell_argon_error_level') - let l:type = 'E' - let l:max_c = ale#Var(a:buffer, 'haskell_argon_error_level') - elseif l:complexity >= ale#Var(a:buffer, 'haskell_argon_warn_level') - let l:type = 'W' - let l:max_c = ale#Var(a:buffer, 'haskell_argon_warn_level') - else - let l:type = 'I' - let l:max_c = ale#Var(a:buffer, 'haskell_argon_info_level') - endif - - call add(l:output, { - \ 'filename': l:error.path, - \ 'lnum': l:block.lineno, - \ 'col': l:block.col, - \ 'text': l:block.name . ': cyclomatic complexity of ' . l:complexity, - \ 'type': l:type, - \}) - endfor - endfor - - return l:output -endfunction - - -call ale#linter#Define('haskell', { -\ 'name': 'argon', -\ 'executable_callback': 'ale_linters#haskell#argon#GetExecutable', -\ 'command_callback': 'ale_linters#haskell#argon#GetCommand', -\ 'callback': 'ale_linters#haskell#argon#Handle', -\}) - diff --git a/plugin/keys.vim b/plugin/keys.vim index 0cdc6d0..543b8c2 100644 --- a/plugin/keys.vim +++ b/plugin/keys.vim @@ -29,6 +29,7 @@ noremap e j noremap o k noremap n h noremap i l +vnoremap i l noremap k n noremap h e noremap l o @@ -323,34 +324,56 @@ nnoremap :call ToggleLocList() " NERDTree +if !exists('g:vscode') noremap :NERDTreeToggle " noremap :TagbarToggle inoremap :TagbarToggle +endif " vista nmap :Vista!! " NERDComment +if !exists('g:vscode') nnoremap :call NERDComment("n", "Toggle") vnoremap :call NERDComment("v", "Toggle") +endif " YCM +if !exists('g:vscode') nmap :YcmCompleter GoTo:wincmd o +endif " vim-clap -nnoremap ag :Clap grep ++query= -" nnoremap tg :Clap proj_tags ++query= -nmap :Clap files -nmap :Clap tags -nmap :Clap proj_tags -nmap :Clap buffers -nnoremap tb :Clap generated_tags ++query= +if !exists('g:vscode') + if has('nvim') + nnoremap ag lua require('telescope.builtin').live_grep({ default_text = vim.fn.expand("") }) + nnoremap tg lua require('telescope.builtin').tags({ default_text = vim.fn.expand("") }) + nmap :call ComIfGit('lua require("telescope.builtin").git_files()', 'lua require("telescope.builtin").find_files()') + nmap lua require('telescope.builtin').tags() + nmap lua require('telescope.builtin').buffers() + nmap lua require('telescope.builtin').diagnostics() + nmap lua require('telescope.builtin').lsp_document_symbols() + nnoremap ls lua require('telescope.builtin').lsp_document_symbols({ default_text = vim.fn.expand("") }) + else + nnoremap ag :Clap grep ++query= + nnoremap dg :Clap dumb_jump ++query= + " nnoremap tg :Clap proj_tags ++query= + nmap :call ComIfGit('Clap gfiles', 'Clap files') + nmap :Clap tags + nmap :Clap proj_tags + nmap :Clap buffers + nnoremap tb :Clap proj_tags ++query= + endif +endif +" tags nnoremap tg :tag =expand("") nnoremap tp :ptag =expand("") nnoremap ts :ts =expand("") " gitgutter +if !exists('g:vscode') nmap ggt :GitGutterToggle nmap nh (GitGutterNextHunk) nmap bh (GitGutterPrevHunk) @@ -376,29 +399,54 @@ omap ic (GitGutterTextObjectInnerPending) omap ac (GitGutterTextObjectOuterPending) xmap ic (GitGutterTextObjectInnerVisual) xmap ac (GitGutterTextObjectOuterVisual) +endif " fastfold nmap zuz (FastFoldUpdate) -"LanguageClient-neovim -" Required for operations modifying multiple buffers like rename. -set hidden -nnoremap lc :call LanguageClient_contextMenu() -" Or map each action separately -nnoremap T :call LanguageClient#textDocument_hover() -nnoremap gd :call LanguageClient#textDocument_definition() -" nnoremap :call LanguageClient#textDocument_rename() -" nnoremap ld :call LanguageClient#textDocument_definition() -" nnoremap lr :call LanguageClient#textDocument_rename() -" nnoremap lf :call LanguageClient#textDocument_formatting() -" nnoremap lt :call LanguageClient#textDocument_typeDefinition() -" nnoremap lx :call LanguageClient#textDocument_references() -" nnoremap la :call LanguageClient_workspace_applyEdit() -" nnoremap lc :call LanguageClient#textDocument_completion() -" nnoremap lh :call LanguageClient#textDocument_hover() -nnoremap la :call LanguageClient#textDocument_codeAction() -nnoremap rn :call LanguageClient#textDocument_rename() +if exists('g:vscode') +nnoremap T :call VSCodeNotify('editor.action.showHover') +nnoremap gd :call VSCodeNotify('editor.action.revealDefinition') -nnoremap ,g (lcn-diagnostics-next) -nnoremap .g (lcn-diagnostics-prev) +else + if has('nvim') + nnoremap T :lua vim.lsp.buf.hover() + nnoremap gd :lua vim.lsp.buf.definition() + nnoremap la :lua vim.lsp.buf.code_action() + nnoremap rn :lua vim.lsp.buf.rename() + nnoremap ln (lcn-diagnostics-next) + nnoremap lp (lcn-diagnostics-prev) + + " Vim Script + nnoremap xx TroubleToggle + nnoremap xw TroubleToggle workspace_diagnostics + nnoremap xd TroubleToggle document_diagnostics + nnoremap xq TroubleToggle quickfix + nnoremap xl TroubleToggle loclist + nnoremap gR TroubleToggle lsp_references + + else + "LanguageClient-neovim + " Required for operations modifying multiple buffers like rename. + set hidden + nnoremap lc :call LanguageClient_contextMenu() + " Or map each action separately + nnoremap T :call LanguageClient#textDocument_hover() + nnoremap gd :call LanguageClient#textDocument_definition() + " nnoremap :call LanguageClient#textDocument_rename() + " nnoremap ld :call LanguageClient#textDocument_definition() + " nnoremap lr :call LanguageClient#textDocument_rename() + " nnoremap lf :call LanguageClient#textDocument_formatting() + " nnoremap lt :call LanguageClient#textDocument_typeDefinition() + " nnoremap lx :call LanguageClient#textDocument_references() + " nnoremap la :call LanguageClient_workspace_applyEdit() + " nnoremap lc :call LanguageClient#textDocument_completion() + " nnoremap lh :call LanguageClient#textDocument_hover() + nnoremap la :call LanguageClient#textDocument_codeAction() + nnoremap rn :call LanguageClient#textDocument_rename() + + nnoremap ln (lcn-diagnostics-next) + nnoremap lp (lcn-diagnostics-prev) + endif +endif diff --git a/plugins.toml b/plugins.toml index bc81a20..b2d298b 100644 --- a/plugins.toml +++ b/plugins.toml @@ -1,7 +1,56 @@ [[plugins]] +repo = 'purescript-contrib/purescript-vim' +[[plugins]] +repo = 'PProvost/vim-ps1' +[[plugins]] +repo = 'nvim-lua/popup.nvim' +on_if = 'has("nvim")' +[[plugins]] +repo = 'nvim-lua/plenary.nvim' +on_if = 'has("nvim")' +[[plugins]] +repo = 'Twinside/vim-haskellFold' +hook_post_source = ''' +call SetHaskellFolding() +''' +on_ft = ['haskell'] +[[plugins]] +repo = 'kana/vim-submode' +hook_add = ''' +" A message will appear in the message line when you're in a submode +" and stay there until the mode has exited. +let g:submode_always_show_submode = 1 + +let g:submode_keep_leaving_key = 1 + +let g:submode_timeout = 0 + +" We're taking over the default setting. Don't worry we'll do +" our best to put back the default functionality. +call submode#enter_with('nav', 'n', '', '') + +call submode#map('nav', 'n', 's', 'e', ':normal! 6j') +call submode#map('nav', 'n', 's', 'o', ':normal! 6k') +call submode#map('nav', 'n', 's', ',', 'normal! ') +call submode#map('nav', 'n', 's', '.', 'normal! ') +call submode#map('nav', 'n', 's', ']', 'normal! ') +call submode#map('nav', 'n', 's', '[', 'normal! ') +call submode#map('nav', 'n', '', 'n', 'B') +call submode#map('nav', 'n', '', 'i', 'W') +call submode#map('nav', 'n', 's', '', ':tabprevious') +call submode#map('nav', 'n', 's', '=', ':tabnext') +''' +on_if = '!exists("g:vscode")' +[[plugins]] +repo = 'jparise/vim-graphql' +[[plugins]] repo = 'mileszs/ack.vim' +# [[plugins]] +# repo = 'vim-scripts/cmdalias.vim' [[plugins]] -repo = 'vim-scripts/cmdalias.vim' +repo = 'easymotion/vim-easymotion' +hook_add = ''' +''' [[plugins]] repo = 'Raimondi/delimitMate' hook_add = ''' @@ -12,12 +61,14 @@ hook_add = ''' ''' [[plugins]] repo = 'vim-scripts/genindent.vim' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'scrooloose/nerdcommenter' hook_add = ''' let NERDSpaceDelims=1 let NERDCreateDefaultMappings=0 ''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'scrooloose/nerdtree' on_event = 'NERDTreeToggle' @@ -31,11 +82,17 @@ hook_add = ''' autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif ''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'Xuyuanp/nerdtree-git-plugin' on_event = 'NERDTreeToggle' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'xolox/vim-easytags' +hook_add = ''' + let g:easytags_async = 1 +''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'xolox/vim-misc' [[plugins]] @@ -45,9 +102,14 @@ repo = 'Shougo/vimproc.vim' build = 'make' [[plugins]] repo = 'sjbach/lusty' +hook_add = ''' +let g:LustyExplorerSuppressRubyWarning = 1 +''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'nixprime/cpsm' build = 'sh -c "PY3=ON ./install.sh"' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'liuchengxu/vista.vim' hook_add = ''' @@ -57,11 +119,15 @@ hook_add = ''' \ 'yaml': 'hasktags -x -o - -c', \ } ''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'sbdchd/neoformat' hook_add = ''' let g:neoformat_enabled_haskell = ['brittany'] + let g:neoformat_enabled_typescript = ['prettier'] + let g:neoformat_try_node_exe = 1 ''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'AndrewRadev/bufferize.vim' [[plugins]] @@ -75,6 +141,7 @@ hook_add = ''' ''' [[plugins]] repo = 'tpope/vim-scriptease' +on_if = '!has("nvim")' [[plugins]] repo = 'Konfekt/FastFold' hook_add = ''' @@ -104,6 +171,7 @@ hook_add = ''' ''' [[plugins]] repo = 'hasufell/ghcup.vim' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'junegunn/vim-easy-align' [[plugins]] @@ -139,12 +207,13 @@ hook_add = ''' let g:clap_layout = {'relative': 'editor', 'width': '95%', 'height': '33%', 'row': '33%', 'col': '5%'} let g:clap_use_pure_python = 1 - function! MultiGrep(...) abort + function! MultiClap(com, ...) abort let opts = map(copy(a:000), "printf('++query=%s', v:val)") - execute 'Clap grep' join(opts, ' ') + execute 'Clap ' a:com join(opts, ' ') endfunction - command! -nargs=* Rag call MultiGrep() + command! -nargs=* Rag call MultiClap('grep', ) + command! -nargs=* Dag call MultiClap('dumb_jump', ) let g:clap_provider_generated_tags = { \ 'source': {-> Tags__source()}, @@ -159,21 +228,30 @@ hook_add = ''' " Let vim handle the tag execute 'tag' split(a:line, '\t')[0] endfunc + + cabbrev C Clap + cabbrev c Clap + cabbrev cp Clap proj_tags ''' +on_if = '!has("nvim") && !exists("g:vscode")' # scm [[plugins]] repo = 'tpope/vim-fugitive' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'tpope/vim-rhubarb' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'tommcdo/vim-fubitive' [[plugins]] +on_if = '!exists("g:vscode")' repo = 'airblade/vim-gitgutter' hook_add = ''' " https://github.com/airblade/vim-gitgutter/issues/696 autocmd ColorScheme * highlight! link SignColumn LineNr ''' +on_if = '!exists("g:vscode")' # local vimrc [[plugins]] @@ -212,7 +290,9 @@ repo = 'LucHermitte/local_vimrc' repo = 'Shougo/deoplete.nvim' hook_add = ''' let g:deoplete#enable_at_startup = 0 + autocmd FileType TelescopePrompt call deoplete#custom#buffer_option('auto_complete', v:false) ''' +on_if = '!exists("g:vscode")' [[plugins]] repo = 'roxma/nvim-yarp' on_if = '!has("nvim")' @@ -224,16 +304,16 @@ on_if = '!has("nvim")' [[plugins]] repo = 'dense-analysis/ale' # build = 'bash -c "cp -R ~/.vim/ale_linters ."' -on_ft = ['sh', 'vim'] hook_add = ''' let g:ale_enabled = 1 - let g:ale_haskell_hie_executable = $HOME . '/.ghcup/bin/haskell-language-server-wrapper' - let g:ale_linters = {'haskell':['hie'], 'c':[]} + " let g:ale_haskell_hie_executable = $HOME . '/.ghcup/bin/haskell-language-server-wrapper' + " let g:ale_linters = {'haskell':['hie'], 'c':[]} let g:ale_linters_explicit = 1 let g:ale_haskell_argon_error_level = 14 let g:ale_haskell_argon_warn_level = 10 let g:ale_haskell_argon_info_level = 6 ''' +on_if = 'index(["sh", "vim"], &ft) >= 0 && !exists("g:vscode")' # LSP [[plugins]] @@ -290,10 +370,16 @@ hook_add = ''' let g:LanguageClient_loggingFile = expand('~/LanguageClient.log') let g:LanguageClient_serverStderr = expand('~/LanguageServer.log') - let g:LanguageClient_rootMarkers = {'haskell': ['cabal.project', '*.cabal', 'stack.yaml'] } + let g:LanguageClient_rootMarkers = { + \ 'haskell': ['cabal.project', '*.cabal', 'stack.yaml'], + \ 'elm': ['elm.json'] + \ } let g:LanguageClient_serverCommands = { \ 'haskell': ['haskell-language-server-wrapper', '--lsp', '--logfile', $HOME.'/hls-server.log'], + \ 'purescript': ['~/.npm-modules/bin/purescript-language-server', '--stdio'], + \ 'elm': ['elm-language-server'], + \ 'typescript': ['typescript-language-server', '--stdio'] \ } ''' #[[plugins]] @@ -337,7 +423,6 @@ hook_add = ''' # multi language [[plugins]] repo = 'luochen1990/rainbow' -on_ft = ['clojure', 'haskell', 'python'] hook_add = ''' let g:rainbow_conf = { \ 'guifgs': ['#DC322F', 'royalblue3', 'darkorange3', 'seagreen3'], @@ -345,11 +430,11 @@ hook_add = ''' \} let g:rainbow_active = 1 ''' +on_if = 'index(["clojure", "haskell", "python"], &ft) >= 0 && !exists("g:vscode")' # haskell [[plugins]] repo = 'neovimhaskell/haskell-vim' -on_ft = ['haskell', 'cabal'] hook_add = ''' let g:haskell_classic_highlighting = 1 let g:haskell_indent_disable = 1 @@ -369,19 +454,20 @@ hook_add = ''' let g:haskell_indent_guard = 4 " let g:haskell_disable_TH = 1 ''' +on_if = 'index(["haskell", "cabal"], &ft) >= 0 && !exists("g:vscode")' [[plugins]] repo = 'Twinside/vim-hoogle' -on_ft = ['haskell'] hook_source = ''' nnoremap ho :Hoogle nnoremap hc :HoogleClose ''' +on_if = 'index(["haskell"], &ft) >= 0 && !exists("g:vscode")' [[plugins]] repo = 'alx741/vim-stylishask' -on_ft = ['haskell'] hook_add = ''' let g:stylishask_on_save = 0 ''' +on_if = 'index(["haskell"], &ft) >= 0 && !exists("g:vscode")' [[plugins]] repo = 'fatih/vim-go' @@ -393,11 +479,6 @@ hook_post_source = 'GoInstallBinaries' repo = 'rust-lang/rust.vim' on_ft = ['rust'] -# javascript -[[plugins]] -repo = 'pangloss/vim-javascript' -on_ft = ['javascript'] - # python [[plugins]] repo = 'python-mode/python-mode' @@ -413,23 +494,35 @@ repo = 'manicmaniac/coconut.vim' on_ft = ['python'] [[plugins]] repo = 'alfredodeza/pytest.vim' -on_ft = ['python'] +on_if = 'index(["python"], &ft) >= 0 && !exists("g:vscode")' [[plugins]] repo = 'idanarye/vim-vebugger' -on_ft = ['python'] +on_if = 'index(["python"], &ft) >= 0 && !exists("g:vscode")' # scala [[plugins]] repo = 'derekwyatt/vim-scala' -on_ft = ['scala'] +on_if = 'index(["scala"], &ft) >= 0 && !exists("g:vscode")' + +# javascript +[[plugins]] +repo = 'pangloss/vim-javascript' +on_ft = ['typescript', 'javascript'] +[[plugins]] +repo = 'MaxMEllon/vim-jsx-pretty' +on_ft = ['typescript', 'javascript'] # typescript [[plugins]] repo = 'leafgarland/typescript-vim' -on_ft = ['typescript'] +on_ft = ['typescript', 'javascript'] +#[[plugins]] +#repo = 'Quramy/tsuquyomi' +#on_ft = ['typescript', 'javascript'] [[plugins]] -repo = 'Quramy/tsuquyomi' -on_ft = ['typescript'] +repo = 'prettier/vim-prettier' +on_ft = ['typescript', 'javascript'] +build = 'npm install' # color and beauty @@ -486,6 +579,7 @@ rtp = 'ScrollColor' name = 'bufonly' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' rtp = 'bufonly' +on_if = '!exists("g:vscode")' [[plugins]] name = 'colorschemedgrade' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' @@ -503,10 +597,12 @@ on_if = '!has("nvim")' name = 'fuzzyfinder' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' rtp = 'fuzzyfinder' +on_if = '!exists("g:vscode")' [[plugins]] name = 'log' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' rtp = 'log' +on_if = '!exists("g:vscode")' #[[plugins]] #repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' #rtp = 'paredit' @@ -517,3 +613,40 @@ rtp = 'log' name = 'txtfmt' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' rtp = 'txtfmt' +on_if = '!exists("g:vscode")' + + +[[plugins]] +repo = 'neovim/nvim-lspconfig' +hook_add = ''' +lua require('lspconfig').hls.setup{} +''' +on_if = 'has("nvim") && !exists("g:vscode")' +lazy = false + +[[plugins]] +repo = 'kyazdani42/nvim-web-devicons' +on_if = 'has("nvim") && !exists("g:vscode")' +lazy = false + +[[plugins]] +repo = 'folke/trouble.nvim' +hook_add = ''' +lua << EOF + require("trouble").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + action_keys = { -- key mappings for actions in the trouble list + jump_close = {"t"}, -- jump to the diagnostic and close the list + } + } +EOF +''' +lazy = false +on_if = 'has("nvim") && !exists("g:vscode")' + +[[plugins]] +repo = 'nvim-telescope/telescope.nvim' +lazy = false +on_if = 'has("nvim") && !exists("g:vscode")' diff --git a/vimrc b/vimrc index 07ff651..155561a 100644 --- a/vimrc +++ b/vimrc @@ -7,11 +7,15 @@ let g:pymode_python = 'python3' " plugin stuff filetype plugin on -filetype indent on set backspace=indent,eol,start " backspace through everything in insert mode set cmdheight=1 +" if has("gui_running") + " autocmd GUIEnter * set vb t_vb= +" endif +set belloff=all + set wildmenu " set wildmode=longest,list,full @@ -27,7 +31,7 @@ let s:toml = $HOME . '/.vim/plugins.toml' " Required: if dein#load_state($HOME . '/.cache/dein') call dein#begin($HOME . '/.cache/dein', [$HOME . '/.vim/vimrc', $HOME . '/.vim/plugins.toml']) - + call dein#add('wsdjeg/dein-ui.vim') call dein#load_toml(s:toml) " Let dein manage dein @@ -38,9 +42,11 @@ if dein#load_state($HOME . '/.cache/dein') call dein#end() call dein#save_state() endif +filetype plugin indent on " ===== further plugin initialization and default config ===== so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim +so ~/.vim/autoload/log-autocmds.vim " lustyexplorer set hidden @@ -84,7 +90,7 @@ set mouse=a set autoread set number set encoding=utf8 -set guifont=Monospace\ 14 +set guifont=Hack\ Nerd\ Font\ Mono\ 16 set clipboard=unnamedplus set textwidth=0 set tabstop=4 @@ -195,6 +201,14 @@ fun! StripTrailingWhitespaces() call cursor(l, c) endfun +function! ComIfGit(com1, com2) + silent! !git rev-parse --is-inside-work-tree + if v:shell_error == 0 + execute a:com1 + else + execute a:com2 + endif +endfunction " =========================== @@ -251,4 +265,18 @@ function! ManCurrentWord() exe '!man 3 ' . word endfunction + +"""""""""""""""""""""""""""""" +" Close preview after typing +"""""""""""""""""""""""""""""" +autocmd WinEnter * call ClosePreviewWindow() +function ClosePreviewWindow() + if getwinvar(winnr("#"), "&pvw") == 1 + pclose + endif +endfunction + + +set title + " vim:foldmethod=marker:foldlevel=0