Compare commits
3 Commits
005a3f1c1f
...
workman
| Author | SHA1 | Date | |
|---|---|---|---|
|
eadc5b4c75
|
|||
|
d07f8f78e1
|
|||
| b8e13b4e34 |
@@ -35,9 +35,6 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
call deoplete#enable()
|
call deoplete#enable()
|
||||||
call deoplete#custom#source('LanguageClient',
|
|
||||||
\ 'min_pattern_length',
|
|
||||||
\ 2)
|
|
||||||
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
|
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ call deoplete#custom#option('sources', {
|
|||||||
call deoplete#custom#source('ale', 'rank', 999)
|
call deoplete#custom#source('ale', 'rank', 999)
|
||||||
call deoplete#custom#source('ale', 'input_pattern', '[^. *\t]\.\w*')
|
call deoplete#custom#source('ale', 'input_pattern', '[^. *\t]\.\w*')
|
||||||
|
|
||||||
autocmd FileType typescript setlocal balloonexpr=tsuquyomi#balloonexpr()
|
" autocmd FileType typescript setlocal balloonexpr=tsuquyomi#balloonexpr()
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
if has('nvim') && !exists("g:vscode")
|
||||||
|
lua << EOF
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
signs = true,
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
severity_sort = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.o.updatetime = 300
|
||||||
|
|
||||||
|
-- Show all diagnostics on current line in floating window
|
||||||
|
--vim.api.nvim_set_keymap(
|
||||||
|
-- 'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>',
|
||||||
|
-- { 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', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>',
|
||||||
|
-- { 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', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>',
|
||||||
|
-- { noremap = true, silent = true }
|
||||||
|
--)
|
||||||
|
|
||||||
|
-- IMPORTANT!: this is only a showcase of how you can set default options!
|
||||||
|
require("telescope").setup {
|
||||||
|
extensions = {
|
||||||
|
file_browser = {
|
||||||
|
grouped = true,
|
||||||
|
theme = "ivy",
|
||||||
|
mappings = {
|
||||||
|
["i"] = {
|
||||||
|
-- your custom insert mode mappings
|
||||||
|
},
|
||||||
|
["n"] = {
|
||||||
|
-- your custom normal mode mappings
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
-- To get telescope-file-browser loaded and working with telescope,
|
||||||
|
-- you need to call load_extension, somewhere after setup function:
|
||||||
|
require("telescope").load_extension "file_browser"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
" Author: Julian Ospald <hasufell@hasufell.de>
|
|
||||||
" 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',
|
|
||||||
\})
|
|
||||||
|
|
||||||
119
autoload/log-autocmds.vim
Normal file
119
autoload/log-autocmds.vim
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
command! LogAutocmds call s:log_autocmds_toggle()
|
||||||
|
|
||||||
|
function! s:log_autocmds_toggle()
|
||||||
|
augroup LogAutocmd
|
||||||
|
autocmd!
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
let l:date = strftime('%F', localtime())
|
||||||
|
let s:activate = get(s:, 'activate', 0) ? 0 : 1
|
||||||
|
if !s:activate
|
||||||
|
call s:log('Stopped autocmd log (' . l:date . ')')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
call s:log('Started autocmd log (' . l:date . ')')
|
||||||
|
augroup LogAutocmd
|
||||||
|
for l:au in s:aulist
|
||||||
|
silent execute 'autocmd' l:au '* call s:log(''' . l:au . ''')'
|
||||||
|
endfor
|
||||||
|
augroup END
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:log(message)
|
||||||
|
silent execute '!echo "'
|
||||||
|
\ . strftime('%T', localtime()) . ' - ' . a:message . '"'
|
||||||
|
\ '>> /tmp/vim_log_autocommands'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" These are deliberately left out due to side effects
|
||||||
|
" - SourceCmd
|
||||||
|
" - FileAppendCmd
|
||||||
|
" - FileWriteCmd
|
||||||
|
" - BufWriteCmd
|
||||||
|
" - FileReadCmd
|
||||||
|
" - BufReadCmd
|
||||||
|
" - FuncUndefined
|
||||||
|
|
||||||
|
let s:aulist = [
|
||||||
|
\ 'BufNewFile',
|
||||||
|
\ 'BufReadPre',
|
||||||
|
\ 'BufRead',
|
||||||
|
\ 'BufReadPost',
|
||||||
|
\ 'FileReadPre',
|
||||||
|
\ 'FileReadPost',
|
||||||
|
\ 'FilterReadPre',
|
||||||
|
\ 'FilterReadPost',
|
||||||
|
\ 'StdinReadPre',
|
||||||
|
\ 'StdinReadPost',
|
||||||
|
\ 'BufWrite',
|
||||||
|
\ 'BufWritePre',
|
||||||
|
\ 'BufWritePost',
|
||||||
|
\ 'FileWritePre',
|
||||||
|
\ 'FileWritePost',
|
||||||
|
\ 'FileAppendPre',
|
||||||
|
\ 'FileAppendPost',
|
||||||
|
\ 'FilterWritePre',
|
||||||
|
\ 'FilterWritePost',
|
||||||
|
\ 'BufAdd',
|
||||||
|
\ 'BufCreate',
|
||||||
|
\ 'BufDelete',
|
||||||
|
\ 'BufWipeout',
|
||||||
|
\ 'BufFilePre',
|
||||||
|
\ 'BufFilePost',
|
||||||
|
\ 'BufEnter',
|
||||||
|
\ 'BufLeave',
|
||||||
|
\ 'BufWinEnter',
|
||||||
|
\ 'BufWinLeave',
|
||||||
|
\ 'BufUnload',
|
||||||
|
\ 'BufHidden',
|
||||||
|
\ 'BufNew',
|
||||||
|
\ 'SwapExists',
|
||||||
|
\ 'FileType',
|
||||||
|
\ 'Syntax',
|
||||||
|
\ 'EncodingChanged',
|
||||||
|
\ 'TermChanged',
|
||||||
|
\ 'VimEnter',
|
||||||
|
\ 'GUIEnter',
|
||||||
|
\ 'GUIFailed',
|
||||||
|
\ 'TermResponse',
|
||||||
|
\ 'QuitPre',
|
||||||
|
\ 'VimLeavePre',
|
||||||
|
\ 'VimLeave',
|
||||||
|
\ 'FileChangedShell',
|
||||||
|
\ 'FileChangedShellPost',
|
||||||
|
\ 'FileChangedRO',
|
||||||
|
\ 'ShellCmdPost',
|
||||||
|
\ 'ShellFilterPost',
|
||||||
|
\ 'CmdUndefined',
|
||||||
|
\ 'SpellFileMissing',
|
||||||
|
\ 'SourcePre',
|
||||||
|
\ 'VimResized',
|
||||||
|
\ 'FocusGained',
|
||||||
|
\ 'FocusLost',
|
||||||
|
\ 'CursorHold',
|
||||||
|
\ 'CursorHoldI',
|
||||||
|
\ 'CursorMoved',
|
||||||
|
\ 'CursorMovedI',
|
||||||
|
\ 'WinEnter',
|
||||||
|
\ 'WinLeave',
|
||||||
|
\ 'TabEnter',
|
||||||
|
\ 'TabLeave',
|
||||||
|
\ 'CmdwinEnter',
|
||||||
|
\ 'CmdwinLeave',
|
||||||
|
\ 'InsertEnter',
|
||||||
|
\ 'InsertChange',
|
||||||
|
\ 'InsertLeave',
|
||||||
|
\ 'InsertCharPre',
|
||||||
|
\ 'TextChanged',
|
||||||
|
\ 'TextChangedI',
|
||||||
|
\ 'ColorScheme',
|
||||||
|
\ 'RemoteReply',
|
||||||
|
\ 'QuickFixCmdPre',
|
||||||
|
\ 'QuickFixCmdPost',
|
||||||
|
\ 'SessionLoadPost',
|
||||||
|
\ 'MenuPopup',
|
||||||
|
\ 'CompleteDone',
|
||||||
|
\ 'User',
|
||||||
|
\ ]
|
||||||
|
|
||||||
551
autoload/submode.vim
Normal file
551
autoload/submode.vim
Normal file
@@ -0,0 +1,551 @@
|
|||||||
|
" submode - Create your own submodes
|
||||||
|
" Version: 0.3.1
|
||||||
|
" Copyright (C) 2008-2014 kana <http://whileimautomaton.net/>
|
||||||
|
" License: MIT license {{{
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
" a copy of this software and associated documentation files (the
|
||||||
|
" "Software"), to deal in the Software without restriction, including
|
||||||
|
" without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
" distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
" permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
" the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included
|
||||||
|
" in all copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
" }}}
|
||||||
|
" Concept "{{{1
|
||||||
|
"
|
||||||
|
" In the following pseudo code, :MAP means :map or :noremap, and it depends on
|
||||||
|
" user's specification.
|
||||||
|
"
|
||||||
|
" map {key-to-enter}
|
||||||
|
" \ <Plug>(submode-before-entering:{submode}:with:{key-to-enter})
|
||||||
|
" \<Plug>(submode-before-entering:{submode})
|
||||||
|
" \<Plug>(submode-enter:{submode})
|
||||||
|
"
|
||||||
|
" MAP <Plug>(submode-before-entering:{submode}:with:{key-to-enter})
|
||||||
|
" \ {anything}
|
||||||
|
" noremap <Plug>(submode-before-entering:{submode})
|
||||||
|
" \ {tweaking 'timeout' and others}
|
||||||
|
" map <Plug>(submode-enter:{submode})
|
||||||
|
" \ <Plug>(submode-before-action:{submode})
|
||||||
|
" \<Plug>(submode-prefix:{submode})
|
||||||
|
"
|
||||||
|
" map <Plug>(submode-prefix:{submode})
|
||||||
|
" \ <Plug>(submode-leave:{submode})
|
||||||
|
" map <Plug>(submode-prefix:{submode}){the first N keys in {lhs}}
|
||||||
|
" \ <Plug>(submode-leave:{submode})
|
||||||
|
" map <Plug>(submode-prefix:{submode}){lhs}
|
||||||
|
" \ <Plug>(submode-rhs:{submode}:for:{lhs})
|
||||||
|
" \<Plug>(submode-enter:{submode})
|
||||||
|
" MAP <Plug>(submode-rhs:{submode}:for:{lhs})
|
||||||
|
" \ {rhs}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Variables "{{{1
|
||||||
|
|
||||||
|
if !exists('g:submode_always_show_submode')
|
||||||
|
let g:submode_always_show_submode = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:submode_keep_leaving_key')
|
||||||
|
let g:submode_keep_leaving_key = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:submode_keyseqs_to_leave')
|
||||||
|
let g:submode_keyseqs_to_leave = ['<Esc>']
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:submode_timeout')
|
||||||
|
let g:submode_timeout = &timeout
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:submode_timeoutlen')
|
||||||
|
let g:submode_timeoutlen = &timeoutlen
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"" See s:set_up_options() and s:restore_options().
|
||||||
|
"
|
||||||
|
" let s:original_showcmd = &showcmd
|
||||||
|
" let s:original_showmode = &showmode
|
||||||
|
" let s:original_timeout = &timeout
|
||||||
|
" let s:original_timeoutlen = &timeoutlen
|
||||||
|
" let s:original_ttimeout = &ttimeout
|
||||||
|
" let s:original_ttimeoutlen = &ttimeoutlen
|
||||||
|
|
||||||
|
if !exists('s:options_overridden_p')
|
||||||
|
let s:options_overridden_p = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" A padding string to wipe out internal key mappings in 'showcmd' area. (gh-3)
|
||||||
|
"
|
||||||
|
" We use no-break spaces (U+00A0) or dots, depending of the current 'encoding'.
|
||||||
|
" Because
|
||||||
|
"
|
||||||
|
" * A normal space (U+0020) is rendered as "<20>" since Vim 7.4.116.
|
||||||
|
" * U+00A0 is rendered as an invisible glyph if 'encoding' is set to one of
|
||||||
|
" Unicode encodings. Otherwise "| " is rendered instead.
|
||||||
|
let s:STEALTH_TYPEAHEAD =
|
||||||
|
\ &g:encoding =~# '^u'
|
||||||
|
\ ? repeat("\<Char-0xa0>", 5)
|
||||||
|
\ : repeat('.', 10)
|
||||||
|
|
||||||
|
let s:current_submode = ''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Interface "{{{1
|
||||||
|
" :SubmodeRestoreOptions "{{{2
|
||||||
|
|
||||||
|
command! -bar -nargs=0 SubmodeRestoreOptions call submode#restore_options()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! submode#current() "{{{2
|
||||||
|
return s:current_submode
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! submode#enter_with(submode, modes, options, lhs, ...) "{{{2
|
||||||
|
let rhs = 0 < a:0 ? a:1 : '<Nop>'
|
||||||
|
for mode in s:each_char(a:modes)
|
||||||
|
call s:define_entering_mapping(a:submode, mode, a:options, a:lhs, rhs)
|
||||||
|
endfor
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! submode#leave_with(submode, modes, options, lhs) "{{{2
|
||||||
|
let options = substitute(a:modes, 'e', '', 'g') " <Nop> is not expression.
|
||||||
|
return submode#map(a:submode, a:modes, options . 'x', a:lhs, '<Nop>')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! submode#map(submode, modes, options, lhs, rhs) "{{{2
|
||||||
|
for mode in s:each_char(a:modes)
|
||||||
|
call s:define_submode_mapping(a:submode, mode, a:options, a:lhs, a:rhs)
|
||||||
|
endfor
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! submode#restore_options() "{{{2
|
||||||
|
call s:restore_options()
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! submode#unmap(submode, modes, options, lhs) "{{{2
|
||||||
|
for mode in s:each_char(a:modes)
|
||||||
|
call s:undefine_submode_mapping(a:submode, mode, a:options, a:lhs)
|
||||||
|
endfor
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Core "{{{1
|
||||||
|
function! s:define_entering_mapping(submode, mode, options, lhs, rhs) "{{{2
|
||||||
|
execute s:map_command(a:mode, 'r')
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'bu'))
|
||||||
|
\ (a:lhs)
|
||||||
|
\ (s:named_key_before_entering_with(a:submode, a:lhs)
|
||||||
|
\ . s:named_key_before_entering(a:submode)
|
||||||
|
\ . s:named_key_enter(a:submode))
|
||||||
|
|
||||||
|
if !s:mapping_exists_p(s:named_key_enter(a:submode), a:mode)
|
||||||
|
" When the given submode is not defined yet - define the default key
|
||||||
|
" mappings to leave the submode.
|
||||||
|
for keyseq in g:submode_keyseqs_to_leave
|
||||||
|
call submode#leave_with(a:submode, a:mode, a:options, keyseq)
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
|
execute s:map_command(a:mode, s:filter_flags(a:options, 'r'))
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'besu'))
|
||||||
|
\ s:named_key_before_entering_with(a:submode, a:lhs)
|
||||||
|
\ a:rhs
|
||||||
|
execute s:map_command(a:mode, '')
|
||||||
|
\ s:map_options('e')
|
||||||
|
\ s:named_key_before_entering(a:submode)
|
||||||
|
\ printf('<SID>on_entering_submode(%s)', string(a:submode))
|
||||||
|
execute s:map_command(a:mode, 'r')
|
||||||
|
\ s:map_options('')
|
||||||
|
\ s:named_key_enter(a:submode)
|
||||||
|
\ (s:named_key_before_action(a:submode)
|
||||||
|
\ . s:named_key_prefix(a:submode))
|
||||||
|
|
||||||
|
execute s:map_command(a:mode, '')
|
||||||
|
\ s:map_options('e')
|
||||||
|
\ s:named_key_before_action(a:submode)
|
||||||
|
\ printf('<SID>on_executing_action(%s)', string(a:submode))
|
||||||
|
execute s:map_command(a:mode, 'r')
|
||||||
|
\ s:map_options('')
|
||||||
|
\ s:named_key_prefix(a:submode)
|
||||||
|
\ s:named_key_leave(a:submode)
|
||||||
|
" NB: :map-<expr> cannot be used for s:on_leaving_submode(),
|
||||||
|
" because it uses some commands not allowed in :map-<expr>.
|
||||||
|
execute s:map_command(a:mode, '')
|
||||||
|
\ s:map_options('s')
|
||||||
|
\ s:named_key_leave(a:submode)
|
||||||
|
\ printf('%s<SID>on_leaving_submode(%s)<Return>',
|
||||||
|
\ a:mode =~# '[ic]' ? '<C-r>=' : '@=',
|
||||||
|
\ string(a:submode))
|
||||||
|
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:define_submode_mapping(submode, mode, options, lhs, rhs) "{{{2
|
||||||
|
execute s:map_command(a:mode, 'r')
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'bu'))
|
||||||
|
\ (s:named_key_prefix(a:submode) . a:lhs)
|
||||||
|
\ (s:named_key_rhs(a:submode, a:lhs)
|
||||||
|
\ . (s:has_flag_p(a:options, 'x')
|
||||||
|
\ ? s:named_key_leave(a:submode)
|
||||||
|
\ : s:named_key_enter(a:submode)))
|
||||||
|
execute s:map_command(a:mode, s:filter_flags(a:options, 'r'))
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'besu'))
|
||||||
|
\ s:named_key_rhs(a:submode, a:lhs)
|
||||||
|
\ a:rhs
|
||||||
|
|
||||||
|
let keys = s:split_keys(a:lhs)
|
||||||
|
for n in range(1, len(keys) - 1)
|
||||||
|
let first_n_keys = join(keys[:-(n+1)], '')
|
||||||
|
silent! execute s:map_command(a:mode, 'r')
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'bu'))
|
||||||
|
\ (s:named_key_prefix(a:submode) . first_n_keys)
|
||||||
|
\ s:named_key_leave(a:submode)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:undefine_submode_mapping(submode, mode, options, lhs) "{{{2
|
||||||
|
execute s:map_command(a:mode, 'u')
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'b'))
|
||||||
|
\ s:named_key_rhs(a:submode, a:lhs)
|
||||||
|
|
||||||
|
let keys = s:split_keys(a:lhs)
|
||||||
|
for n in range(len(keys), 1, -1)
|
||||||
|
let first_n_keys = join(keys[:n-1], '')
|
||||||
|
execute s:map_command(a:mode, 'u')
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'b'))
|
||||||
|
\ s:named_key_prefix(a:submode) . first_n_keys
|
||||||
|
if s:longer_mapping_exists_p(s:named_key_prefix(a:submode), first_n_keys)
|
||||||
|
execute s:map_command(a:mode, 'r')
|
||||||
|
\ s:map_options(s:filter_flags(a:options, 'b'))
|
||||||
|
\ s:named_key_prefix(a:submode) . first_n_keys
|
||||||
|
\ s:named_key_leave(a:submode)
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Misc. "{{{1
|
||||||
|
function! s:each_char(s) "{{{2
|
||||||
|
return split(a:s, '.\zs')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:filter_flags(s, cs) "{{{2
|
||||||
|
return join(map(s:each_char(a:cs), 's:has_flag_p(a:s, v:val) ? v:val : ""'),
|
||||||
|
\ '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:has_flag_p(s, c) "{{{2
|
||||||
|
return 0 <= stridx(a:s, a:c)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:insert_mode_p(mode) "{{{2
|
||||||
|
return a:mode =~# '^[iR]'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:longer_mapping_exists_p(submode, lhs) "{{{2
|
||||||
|
" FIXME: Implement the proper calculation.
|
||||||
|
" Note that mapcheck() can't be used for this purpose because it may
|
||||||
|
" act as s:shorter_mapping_exists_p() if there is such a mapping.
|
||||||
|
return !0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:map_command(mode, flags) "{{{2
|
||||||
|
if s:has_flag_p(a:flags, 'u')
|
||||||
|
return a:mode . 'unmap'
|
||||||
|
else
|
||||||
|
return a:mode . (s:has_flag_p(a:flags, 'r') ? 'map' : 'noremap')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:map_options(options) "{{{2
|
||||||
|
let _ = {
|
||||||
|
\ 'b': '<buffer>',
|
||||||
|
\ 'e': '<expr>',
|
||||||
|
\ 's': '<silent>',
|
||||||
|
\ 'u': '<unique>',
|
||||||
|
\ }
|
||||||
|
return join(map(s:each_char(a:options), 'get(_, v:val, "")'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:mapping_exists_p(keyseq, mode) "{{{2
|
||||||
|
return maparg(a:keyseq, a:mode) != ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:may_override_showmode_p(mode) "{{{2
|
||||||
|
" Normal mode / Visual mode (& its variants) / Insert mode (& its variants)
|
||||||
|
return a:mode =~# "^[nvV\<C-v>sS\<C-s>]" || s:insert_mode_p(a:mode)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_before_action(submode) "{{{2
|
||||||
|
return printf('<Plug>(submode-before-action:%s)', a:submode)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_before_entering(submode) "{{{2
|
||||||
|
return printf('<Plug>(submode-before-entering:%s)', a:submode)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_before_entering_with(submode, lhs) "{{{2
|
||||||
|
return printf('<Plug>(submode-before-entering:%s:with:%s)', a:submode, a:lhs)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_enter(submode) "{{{2
|
||||||
|
return printf('<Plug>(submode-enter:%s)', a:submode)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_leave(submode) "{{{2
|
||||||
|
return printf('<Plug>(submode-leave:%s)', a:submode)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_prefix(submode) "{{{2
|
||||||
|
return printf('<Plug>(submode-prefix:%s)%s', a:submode, s:STEALTH_TYPEAHEAD)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:named_key_rhs(submode, lhs) "{{{2
|
||||||
|
return printf('<Plug>(submode-rhs:%s:for:%s)', a:submode, a:lhs)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:on_entering_submode(submode) "{{{2
|
||||||
|
call s:set_up_options(a:submode)
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:on_executing_action(submode) "{{{2
|
||||||
|
if (s:original_showmode || g:submode_always_show_submode)
|
||||||
|
\ && s:may_override_showmode_p(mode())
|
||||||
|
echohl ModeMsg
|
||||||
|
echo '-- Submode:' a:submode '--'
|
||||||
|
echohl None
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:on_leaving_submode(submode) "{{{2
|
||||||
|
if (s:original_showmode || g:submode_always_show_submode)
|
||||||
|
\ && s:may_override_showmode_p(mode())
|
||||||
|
if s:insert_mode_p(mode())
|
||||||
|
let cursor_position = getpos('.')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" BUGS: :redraw! doesn't redraw 'showmode'.
|
||||||
|
execute "normal! \<C-l>"
|
||||||
|
|
||||||
|
if s:insert_mode_p(mode())
|
||||||
|
call setpos('.', cursor_position)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if !g:submode_keep_leaving_key && getchar(1) isnot 0
|
||||||
|
" To completely ignore unbound key sequences in a submode,
|
||||||
|
" here we have to fetch and drop the last key in the key sequence.
|
||||||
|
call getchar()
|
||||||
|
endif
|
||||||
|
call s:restore_options()
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:remove_flag(s, c) "{{{2
|
||||||
|
" Assumption: a:c is not a meta character.
|
||||||
|
return substitute(a:s, a:c, '', 'g')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:restore_options() "{{{2
|
||||||
|
if !s:options_overridden_p
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let s:options_overridden_p = 0
|
||||||
|
|
||||||
|
let &showcmd = s:original_showcmd
|
||||||
|
let &showmode = s:original_showmode
|
||||||
|
let &timeout = s:original_timeout
|
||||||
|
let &timeoutlen = s:original_timeoutlen
|
||||||
|
let &ttimeout = s:original_ttimeout
|
||||||
|
let &ttimeoutlen = s:original_ttimeoutlen
|
||||||
|
|
||||||
|
let s:current_submode = ''
|
||||||
|
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:set_up_options(submode) "{{{2
|
||||||
|
if s:options_overridden_p
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let s:options_overridden_p = !0
|
||||||
|
|
||||||
|
let s:original_showcmd = &showcmd
|
||||||
|
let s:original_showmode = &showmode
|
||||||
|
let s:original_timeout = &timeout
|
||||||
|
let s:original_timeoutlen = &timeoutlen
|
||||||
|
let s:original_ttimeout = &ttimeout
|
||||||
|
let s:original_ttimeoutlen = &ttimeoutlen
|
||||||
|
|
||||||
|
" NB: 'showcmd' must be enabled to render the cursor properly.
|
||||||
|
" If 'showcmd' is disabled and the current submode message is rendered, the
|
||||||
|
" cursor is rendered at the end of the message, not the actual position in
|
||||||
|
" the current window. (gh-9)
|
||||||
|
set showcmd
|
||||||
|
set noshowmode
|
||||||
|
let &timeout = g:submode_timeout
|
||||||
|
let &ttimeout = s:original_timeout ? !0 : s:original_ttimeout
|
||||||
|
let &timeoutlen = g:submode_timeoutlen
|
||||||
|
let &ttimeoutlen = s:original_ttimeoutlen < 0
|
||||||
|
\ ? s:original_timeoutlen
|
||||||
|
\ : s:original_ttimeoutlen
|
||||||
|
|
||||||
|
let s:current_submode = a:submode
|
||||||
|
|
||||||
|
return
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:split_keys(keyseq) "{{{2
|
||||||
|
" Assumption: Special keys such as <C-u> are escaped with < and >, i.e.,
|
||||||
|
" a:keyseq doesn't directly contain any escape sequences.
|
||||||
|
return split(a:keyseq, '\(<[^<>]\+>\|.\)\zs')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" __END__ "{{{1
|
||||||
|
" vim: foldmethod=marker
|
||||||
|
|
||||||
|
|
||||||
113
plugin/keys.vim
113
plugin/keys.vim
@@ -3,6 +3,12 @@ let g:mapleader = ' '
|
|||||||
|
|
||||||
inoremap <C-u> <Esc>
|
inoremap <C-u> <Esc>
|
||||||
|
|
||||||
|
nnoremap <C-,> :tabprevious<CR>
|
||||||
|
nnoremap <C-.> :tabnext<CR>
|
||||||
|
|
||||||
|
noremap <C-PageUp> gT
|
||||||
|
noremap <C-PageDown> gt
|
||||||
|
|
||||||
"
|
"
|
||||||
nnoremap <Leader>tk <C-w><C-]><C-w>T
|
nnoremap <Leader>tk <C-w><C-]><C-w>T
|
||||||
|
|
||||||
@@ -23,6 +29,7 @@ noremap e j
|
|||||||
noremap o k
|
noremap o k
|
||||||
noremap n h
|
noremap n h
|
||||||
noremap i l
|
noremap i l
|
||||||
|
vnoremap i l
|
||||||
noremap k n
|
noremap k n
|
||||||
noremap h e
|
noremap h e
|
||||||
noremap l o
|
noremap l o
|
||||||
@@ -271,7 +278,7 @@ nnoremap <S-C> <c-v>
|
|||||||
|
|
||||||
" write
|
" write
|
||||||
noremap <C-s> :w<CR>
|
noremap <C-s> :w<CR>
|
||||||
inoremap <C-s> <C-O>:w<CR>
|
inoremap <C-s> <Esc>:w<CR>
|
||||||
|
|
||||||
" exit
|
" exit
|
||||||
noremap <C-q> :qa!<CR>
|
noremap <C-q> :qa!<CR>
|
||||||
@@ -288,8 +295,7 @@ inoremap <C-A> <C-O>:call Select()<CR>
|
|||||||
|
|
||||||
nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
|
nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
|
||||||
|
|
||||||
nnoremap <Leader>cc :cclose<CR>
|
nnoremap <Leader>cc :call ToggleQuickFix()<CR>
|
||||||
nnoremap <Leader>co :copen<CR>
|
|
||||||
|
|
||||||
function! ToggleQuickFix()
|
function! ToggleQuickFix()
|
||||||
if empty(filter(getwininfo(), 'v:val.quickfix'))
|
if empty(filter(getwininfo(), 'v:val.quickfix'))
|
||||||
@@ -317,33 +323,57 @@ nnoremap <silent> <F4> :call ToggleLocList()<CR>
|
|||||||
|
|
||||||
|
|
||||||
" NERDTree
|
" NERDTree
|
||||||
|
if !exists('g:vscode')
|
||||||
|
" noremap <C-j> :Telescope file_browser<CR>
|
||||||
noremap <C-j> :NERDTreeToggle<CR>
|
noremap <C-j> :NERDTreeToggle<CR>
|
||||||
" noremap <C-B> :TagbarToggle<CR>
|
" noremap <C-B> :TagbarToggle<CR>
|
||||||
inoremap <C-B> <C-O>:TagbarToggle<CR>
|
inoremap <C-B> <C-O>:TagbarToggle<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
" vista
|
" vista
|
||||||
nmap <F8> :Vista!!<CR>
|
nmap <F8> :Vista!!<CR>
|
||||||
|
|
||||||
" NERDComment
|
" NERDComment
|
||||||
|
if !exists('g:vscode')
|
||||||
nnoremap <silent> <F10> :call NERDComment("n", "Toggle")<cr>
|
nnoremap <silent> <F10> :call NERDComment("n", "Toggle")<cr>
|
||||||
vnoremap <silent> <F10> <ESC>:call NERDComment("v", "Toggle")<cr>
|
vnoremap <silent> <F10> <ESC>:call NERDComment("v", "Toggle")<cr>
|
||||||
|
endif
|
||||||
|
|
||||||
" YCM
|
" YCM
|
||||||
|
if !exists('g:vscode')
|
||||||
nmap <C-F4> :YcmCompleter GoTo<CR>:wincmd o<CR>
|
nmap <C-F4> :YcmCompleter GoTo<CR>:wincmd o<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
" vim-clap
|
" vim-clap
|
||||||
nnoremap <leader>ag :Clap grep ++query=<cword><CR>
|
if !exists('g:vscode')
|
||||||
" nnoremap <silent> <leader>tg :Clap proj_tags ++query=<cword><CR>
|
if has('nvim')
|
||||||
nmap <C-f> :Clap files<CR>
|
nnoremap <leader>ag <cmd>lua require('telescope.builtin').live_grep({ default_text = vim.fn.expand("<cword>") })<cr>
|
||||||
nmap <F2> :Clap tags<CR>
|
nnoremap <silent> <leader>tg <cmd>lua require('telescope.builtin').tags({ default_text = vim.fn.expand("<cword>") })<cr>
|
||||||
nmap <C-b> :Clap buffers<CR>
|
nmap <silent> <C-f> :call ComIfGit('lua require("telescope.builtin").git_files()', 'lua require("telescope.builtin").find_files()')<CR>
|
||||||
nnoremap <silent> <leader>tb :Clap tags ++query=<cword><CR>
|
nmap <F1> <cmd>lua require('telescope.builtin').tags()<cr>
|
||||||
|
nmap <C-b> <cmd>lua require('telescope.builtin').buffers()<cr>
|
||||||
|
nmap <C-d> <cmd>lua require('telescope.builtin').diagnostics()<cr>
|
||||||
|
nmap <C-l> <cmd>lua require('telescope.builtin').lsp_document_symbols()<cr>
|
||||||
|
nnoremap <leader>ls <cmd>lua require('telescope.builtin').lsp_document_symbols({ default_text = vim.fn.expand("<cword>") })<cr>
|
||||||
|
else
|
||||||
|
nnoremap <leader>ag :Clap grep ++query=<cword><CR>
|
||||||
|
nnoremap <leader>dg :Clap dumb_jump ++query=<cword><CR>
|
||||||
|
" nnoremap <silent> <leader>tg :Clap proj_tags ++query=<cword><CR>
|
||||||
|
nmap <silent> <C-f> :call ComIfGit('Clap gfiles', 'Clap files')<CR>
|
||||||
|
nmap <F1> :Clap tags<CR>
|
||||||
|
nmap <F2> :Clap proj_tags<CR>
|
||||||
|
nmap <C-b> :Clap buffers<CR>
|
||||||
|
nnoremap <silent> <leader>tb :Clap proj_tags ++query=<cword><CR>
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" tags
|
||||||
nnoremap <silent> <leader>tg :tag <C-R>=expand("<cword>")<CR><CR>
|
nnoremap <silent> <leader>tg :tag <C-R>=expand("<cword>")<CR><CR>
|
||||||
nnoremap <silent> <leader>tp :ptag <C-R>=expand("<cword>")<CR><CR>
|
nnoremap <silent> <leader>tp :ptag <C-R>=expand("<cword>")<CR><CR>
|
||||||
nnoremap <silent> <leader>ts :ts <C-R>=expand("<cword>")<CR><CR>
|
nnoremap <silent> <leader>ts :ts <C-R>=expand("<cword>")<CR><CR>
|
||||||
|
|
||||||
" gitgutter
|
" gitgutter
|
||||||
|
if !exists('g:vscode')
|
||||||
nmap <leader>ggt <Esc>:GitGutterToggle<CR>
|
nmap <leader>ggt <Esc>:GitGutterToggle<CR>
|
||||||
nmap <leader>nh <Plug>(GitGutterNextHunk)
|
nmap <leader>nh <Plug>(GitGutterNextHunk)
|
||||||
nmap <leader>bh <Plug>(GitGutterPrevHunk)
|
nmap <leader>bh <Plug>(GitGutterPrevHunk)
|
||||||
@@ -369,29 +399,54 @@ omap <leader>ic <Plug>(GitGutterTextObjectInnerPending)
|
|||||||
omap <leader>ac <Plug>(GitGutterTextObjectOuterPending)
|
omap <leader>ac <Plug>(GitGutterTextObjectOuterPending)
|
||||||
xmap <leader>ic <Plug>(GitGutterTextObjectInnerVisual)
|
xmap <leader>ic <Plug>(GitGutterTextObjectInnerVisual)
|
||||||
xmap <leader>ac <Plug>(GitGutterTextObjectOuterVisual)
|
xmap <leader>ac <Plug>(GitGutterTextObjectOuterVisual)
|
||||||
|
endif
|
||||||
|
|
||||||
" fastfold
|
" fastfold
|
||||||
nmap zuz <Plug>(FastFoldUpdate)
|
nmap zuz <Plug>(FastFoldUpdate)
|
||||||
|
|
||||||
"LanguageClient-neovim
|
if exists('g:vscode')
|
||||||
" Required for operations modifying multiple buffers like rename.
|
nnoremap <silent> T :call VSCodeNotify('editor.action.showHover')<CR>
|
||||||
set hidden
|
nnoremap <silent> gd :call VSCodeNotify('editor.action.revealDefinition')<CR>
|
||||||
nnoremap <leader>lc :call LanguageClient_contextMenu()<CR>
|
|
||||||
" Or map each action separately
|
|
||||||
nnoremap <silent> T :call LanguageClient#textDocument_hover()<CR>
|
|
||||||
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
|
||||||
" nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
|
||||||
" nnoremap <leader>ld :call LanguageClient#textDocument_definition()<CR>
|
|
||||||
" nnoremap <leader>lr :call LanguageClient#textDocument_rename()<CR>
|
|
||||||
" nnoremap <leader>lf :call LanguageClient#textDocument_formatting()<CR>
|
|
||||||
" nnoremap <leader>lt :call LanguageClient#textDocument_typeDefinition()<CR>
|
|
||||||
" nnoremap <leader>lx :call LanguageClient#textDocument_references()<CR>
|
|
||||||
" nnoremap <leader>la :call LanguageClient_workspace_applyEdit()<CR>
|
|
||||||
" nnoremap <leader>lc :call LanguageClient#textDocument_completion()<CR>
|
|
||||||
" nnoremap <leader>lh :call LanguageClient#textDocument_hover()<CR>
|
|
||||||
nnoremap <leader>la :call LanguageClient#textDocument_codeAction()<CR>
|
|
||||||
nnoremap <leader>rn :call LanguageClient#textDocument_rename()<CR>
|
|
||||||
|
|
||||||
nnoremap ,g <Plug>(lcn-diagnostics-next)
|
else
|
||||||
nnoremap .g <Plug>(lcn-diagnostics-prev)
|
if has('nvim')
|
||||||
|
nnoremap <silent> T :lua vim.lsp.buf.hover()<CR>
|
||||||
|
nnoremap <silent> gd :lua vim.lsp.buf.definition()<CR>
|
||||||
|
nnoremap <leader>la :lua vim.lsp.buf.code_action()<CR>
|
||||||
|
nnoremap <leader>rn :lua vim.lsp.buf.rename()<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>ci :lua vim.lsp.buf.incoming_calls()<CR>
|
||||||
|
nnoremap <leader>co :lua vim.lsp.buf.outgoing_calls()<CR>
|
||||||
|
|
||||||
|
" Vim Script
|
||||||
|
nnoremap <leader>xx <cmd>TroubleToggle<cr>
|
||||||
|
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
|
||||||
|
nnoremap <leader>xd <cmd>TroubleToggle document_diagnostics<cr>
|
||||||
|
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
|
||||||
|
nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
|
||||||
|
nnoremap gR <cmd>TroubleToggle lsp_references<cr>
|
||||||
|
|
||||||
|
else
|
||||||
|
"LanguageClient-neovim
|
||||||
|
" Required for operations modifying multiple buffers like rename.
|
||||||
|
set hidden
|
||||||
|
nnoremap <leader>lc :call LanguageClient_contextMenu()<CR>
|
||||||
|
" Or map each action separately
|
||||||
|
nnoremap <silent> T :call LanguageClient#textDocument_hover()<CR>
|
||||||
|
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
||||||
|
" nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
||||||
|
" nnoremap <leader>ld :call LanguageClient#textDocument_definition()<CR>
|
||||||
|
" nnoremap <leader>lr :call LanguageClient#textDocument_rename()<CR>
|
||||||
|
" nnoremap <leader>lf :call LanguageClient#textDocument_formatting()<CR>
|
||||||
|
" nnoremap <leader>lt :call LanguageClient#textDocument_typeDefinition()<CR>
|
||||||
|
" nnoremap <leader>lx :call LanguageClient#textDocument_references()<CR>
|
||||||
|
" nnoremap <leader>la :call LanguageClient_workspace_applyEdit()<CR>
|
||||||
|
" nnoremap <leader>lc :call LanguageClient#textDocument_completion()<CR>
|
||||||
|
" nnoremap <leader>lh :call LanguageClient#textDocument_hover()<CR>
|
||||||
|
nnoremap <leader>la :call LanguageClient#textDocument_codeAction()<CR>
|
||||||
|
nnoremap <leader>rn :call LanguageClient#textDocument_rename()<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>ln <Plug>(lcn-diagnostics-next)
|
||||||
|
nnoremap <leader>lp <Plug>(lcn-diagnostics-prev)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|||||||
444
plugins.toml
444
plugins.toml
@@ -1,7 +1,145 @@
|
|||||||
[[plugins]]
|
[[plugins]]
|
||||||
|
repo = 'dstein64/nvim-scrollview'
|
||||||
|
hook_add = '''
|
||||||
|
lua require('scrollview').setup({ excluded_filetypes = {'nerdtree'}, current_only = true, winblend = 75, base = 'right', column = 1 })
|
||||||
|
'''
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
lazy = false
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'romgrk/fzy-lua-native'
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'gelguy/wilder.nvim'
|
||||||
|
on_event = 'CmdlineEnter'
|
||||||
|
hook_post_source = '''
|
||||||
|
call wilder#setup({
|
||||||
|
\ 'modes': [':', '/', '?'],
|
||||||
|
\ 'enable_cmdline_enter': 0,
|
||||||
|
\ })
|
||||||
|
|
||||||
|
call wilder#set_option('noselect', 0)
|
||||||
|
|
||||||
|
call wilder#set_option('pipeline', [
|
||||||
|
\ wilder#branch(
|
||||||
|
\ wilder#python_file_finder_pipeline({
|
||||||
|
\ 'file_command': {_, arg -> stridx(arg, '.') != -1 ? ['fd', '-tf', '-H'] : ['fd', '-tf']},
|
||||||
|
\ 'dir_command': ['fd', '-td'],
|
||||||
|
\ 'filters': ['cpsm_filter'],
|
||||||
|
\ }),
|
||||||
|
\ wilder#substitute_pipeline({
|
||||||
|
\ 'pipeline': wilder#python_search_pipeline({
|
||||||
|
\ 'skip_cmdtype_check': 1,
|
||||||
|
\ 'pattern': wilder#python_fuzzy_pattern({
|
||||||
|
\ 'start_at_boundary': 0,
|
||||||
|
\ }),
|
||||||
|
\ }),
|
||||||
|
\ }),
|
||||||
|
\ wilder#cmdline_pipeline({
|
||||||
|
\ 'fuzzy': 2,
|
||||||
|
\ 'fuzzy_filter': has('nvim') ? wilder#lua_fzy_filter() : wilder#vim_fuzzy_filter(),
|
||||||
|
\ }),
|
||||||
|
\ [
|
||||||
|
\ wilder#check({_, x -> empty(x)}),
|
||||||
|
\ wilder#history(),
|
||||||
|
\ ],
|
||||||
|
\ wilder#python_search_pipeline({
|
||||||
|
\ 'pattern': wilder#python_fuzzy_pattern({
|
||||||
|
\ 'start_at_boundary': 0,
|
||||||
|
\ }),
|
||||||
|
\ }),
|
||||||
|
\ ),
|
||||||
|
\ ])
|
||||||
|
|
||||||
|
let s:highlighters = [
|
||||||
|
\ wilder#pcre2_highlighter(),
|
||||||
|
\ has('nvim') ? wilder#lua_fzy_highlighter() : wilder#cpsm_highlighter(),
|
||||||
|
\ ]
|
||||||
|
|
||||||
|
let s:popupmenu_renderer = wilder#popupmenu_renderer(wilder#popupmenu_border_theme({
|
||||||
|
\ 'border': 'rounded',
|
||||||
|
\ 'empty_message': wilder#popupmenu_empty_message_with_spinner(),
|
||||||
|
\ 'highlighter': s:highlighters,
|
||||||
|
\ 'left': [
|
||||||
|
\ ' ',
|
||||||
|
\ wilder#popupmenu_devicons(),
|
||||||
|
\ wilder#popupmenu_buffer_flags({
|
||||||
|
\ 'flags': ' a + ',
|
||||||
|
\ 'icons': {'+': '', 'a': '', 'h': ''},
|
||||||
|
\ }),
|
||||||
|
\ ],
|
||||||
|
\ 'right': [
|
||||||
|
\ ' ',
|
||||||
|
\ wilder#popupmenu_scrollbar(),
|
||||||
|
\ ],
|
||||||
|
\ }))
|
||||||
|
|
||||||
|
let s:wildmenu_renderer = wilder#wildmenu_renderer({
|
||||||
|
\ 'highlighter': s:highlighters,
|
||||||
|
\ 'separator': ' · ',
|
||||||
|
\ 'left': [' ', wilder#wildmenu_spinner(), ' '],
|
||||||
|
\ 'right': [' ', wilder#wildmenu_index()],
|
||||||
|
\ })
|
||||||
|
|
||||||
|
call wilder#set_option('renderer', wilder#renderer_mux({
|
||||||
|
\ ':': s:popupmenu_renderer,
|
||||||
|
\ '/': s:wildmenu_renderer,
|
||||||
|
\ 'substitute': s:wildmenu_renderer,
|
||||||
|
\ }))
|
||||||
|
'''
|
||||||
|
#[[plugins]]
|
||||||
|
#repo = 'dstein64/vim-startuptime'
|
||||||
|
[[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 <C-w> setting. Don't worry we'll do
|
||||||
|
" our best to put back the default functionality.
|
||||||
|
call submode#enter_with('nav', 'n', '', '<C-ENTER>')
|
||||||
|
|
||||||
|
call submode#map('nav', 'n', 's', 'e', ':normal! 6j<cr>')
|
||||||
|
call submode#map('nav', 'n', 's', 'o', ':normal! 6k<cr>')
|
||||||
|
call submode#map('nav', 'n', 's', ',', '<Cmd>normal! <C-d><CR>')
|
||||||
|
call submode#map('nav', 'n', 's', '.', '<Cmd>normal! <C-u><CR>')
|
||||||
|
call submode#map('nav', 'n', 's', ']', '<Cmd>normal! <C-b><CR>')
|
||||||
|
call submode#map('nav', 'n', 's', '[', '<Cmd>normal! <C-f><CR>')
|
||||||
|
call submode#map('nav', 'n', '', 'n', 'B')
|
||||||
|
call submode#map('nav', 'n', '', 'i', 'W')
|
||||||
|
call submode#map('nav', 'n', 's', '<ENTER>', ':tabprevious<cr>')
|
||||||
|
call submode#map('nav', 'n', 's', '=', ':tabnext<cr>')
|
||||||
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'jparise/vim-graphql'
|
||||||
|
[[plugins]]
|
||||||
repo = 'mileszs/ack.vim'
|
repo = 'mileszs/ack.vim'
|
||||||
|
# [[plugins]]
|
||||||
|
# repo = 'vim-scripts/cmdalias.vim'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'vim-scripts/cmdalias.vim'
|
repo = 'easymotion/vim-easymotion'
|
||||||
|
hook_add = '''
|
||||||
|
'''
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'Raimondi/delimitMate'
|
repo = 'Raimondi/delimitMate'
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
@@ -12,12 +150,14 @@ hook_add = '''
|
|||||||
'''
|
'''
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'vim-scripts/genindent.vim'
|
repo = 'vim-scripts/genindent.vim'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'scrooloose/nerdcommenter'
|
repo = 'scrooloose/nerdcommenter'
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let NERDSpaceDelims=1
|
let NERDSpaceDelims=1
|
||||||
let NERDCreateDefaultMappings=0
|
let NERDCreateDefaultMappings=0
|
||||||
'''
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'scrooloose/nerdtree'
|
repo = 'scrooloose/nerdtree'
|
||||||
on_event = 'NERDTreeToggle'
|
on_event = 'NERDTreeToggle'
|
||||||
@@ -31,11 +171,16 @@ hook_add = '''
|
|||||||
autocmd StdinReadPre * let s:std_in=1
|
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
|
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]]
|
[[plugins]]
|
||||||
repo = 'Xuyuanp/nerdtree-git-plugin'
|
repo = 'Xuyuanp/nerdtree-git-plugin'
|
||||||
on_event = 'NERDTreeToggle'
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'xolox/vim-easytags'
|
repo = 'xolox/vim-easytags'
|
||||||
|
hook_add = '''
|
||||||
|
let g:easytags_async = 1
|
||||||
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'xolox/vim-misc'
|
repo = 'xolox/vim-misc'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
@@ -45,9 +190,14 @@ repo = 'Shougo/vimproc.vim'
|
|||||||
build = 'make'
|
build = 'make'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'sjbach/lusty'
|
repo = 'sjbach/lusty'
|
||||||
|
hook_add = '''
|
||||||
|
let g:LustyExplorerSuppressRubyWarning = 1
|
||||||
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'nixprime/cpsm'
|
repo = 'nixprime/cpsm'
|
||||||
build = 'sh -c "PY3=ON ./install.sh"'
|
build = 'sh -c "PY3=ON ./install.sh"'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'liuchengxu/vista.vim'
|
repo = 'liuchengxu/vista.vim'
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
@@ -57,11 +207,15 @@ hook_add = '''
|
|||||||
\ 'yaml': 'hasktags -x -o - -c',
|
\ 'yaml': 'hasktags -x -o - -c',
|
||||||
\ }
|
\ }
|
||||||
'''
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'sbdchd/neoformat'
|
repo = 'sbdchd/neoformat'
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let g:neoformat_enabled_haskell = ['brittany']
|
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]]
|
[[plugins]]
|
||||||
repo = 'AndrewRadev/bufferize.vim'
|
repo = 'AndrewRadev/bufferize.vim'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
@@ -75,6 +229,7 @@ hook_add = '''
|
|||||||
'''
|
'''
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'tpope/vim-scriptease'
|
repo = 'tpope/vim-scriptease'
|
||||||
|
on_if = '!has("nvim")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'Konfekt/FastFold'
|
repo = 'Konfekt/FastFold'
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
@@ -104,6 +259,7 @@ hook_add = '''
|
|||||||
'''
|
'''
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'hasufell/ghcup.vim'
|
repo = 'hasufell/ghcup.vim'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'junegunn/vim-easy-align'
|
repo = 'junegunn/vim-easy-align'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
@@ -122,20 +278,58 @@ repo = 'mkitt/tabline.vim'
|
|||||||
repo = 'kshenoy/vim-signature'
|
repo = 'kshenoy/vim-signature'
|
||||||
|
|
||||||
# finder
|
# finder
|
||||||
[[plugins]]
|
#[[plugins]]
|
||||||
repo = 'liuchengxu/vim-clap'
|
#repo = 'liuchengxu/vim-clap'
|
||||||
build = 'make'
|
#build = 'make'
|
||||||
hook_add = '''
|
#hook_add = '''
|
||||||
command -nargs=* Rag Clap grep ++query=<args>
|
# autocmd Filetype clap_input inoremap <silent> <buffer> <kPageDown> <C-R>=clap#navigation#scroll('down')<CR>
|
||||||
let g:clap_layout = {'relative': 'editor', 'width': '95%', 'height': '33%', 'row': '33%', 'col': '5%'}
|
# autocmd Filetype clap_input inoremap <silent> <buffer> <kPageUp> <C-R>=clap#navigation#scroll('up')<CR>
|
||||||
let g:clap_use_pure_python = 1
|
# autocmd Filetype clap_input nnoremap <silent> <buffer> <kPageDown> <C-R>=clap#navigation#scroll('down')<CR>
|
||||||
'''
|
# autocmd Filetype clap_input nnoremap <silent> <buffer> <kPageUp> <C-R>=clap#navigation#scroll('up')<CR>
|
||||||
|
#
|
||||||
|
# let g:clap_popup_move_manager = {
|
||||||
|
# \ "\<kPageUp>": "\<PageUp>",
|
||||||
|
# \ "\<kPageDown>": "\<PageDown>",
|
||||||
|
# \ }
|
||||||
|
#
|
||||||
|
# let g:clap_layout = {'relative': 'editor', 'width': '95%', 'height': '33%', 'row': '33%', 'col': '5%'}
|
||||||
|
# let g:clap_use_pure_python = 1
|
||||||
|
#
|
||||||
|
# function! MultiClap(com, ...) abort
|
||||||
|
# let opts = map(copy(a:000), "printf('++query=%s', v:val)")
|
||||||
|
# execute 'Clap ' a:com join(opts, ' ')
|
||||||
|
# endfunction
|
||||||
|
#
|
||||||
|
# command! -nargs=* Rag call MultiClap('grep', <f-args>)
|
||||||
|
# command! -nargs=* Dag call MultiClap('dumb_jump', <f-args>)
|
||||||
|
#
|
||||||
|
# let g:clap_provider_generated_tags = {
|
||||||
|
# \ 'source': {-> Tags__source()},
|
||||||
|
# \ 'sink': {line -> Tags__sink(line)},
|
||||||
|
# \}
|
||||||
|
#
|
||||||
|
# function! Tags__source ()
|
||||||
|
# return flatten(map(tagfiles(), {_, file -> filter(readfile(file), 'stridx(v:val, "!_TAG") != 0')}))
|
||||||
|
# endfunc
|
||||||
|
#
|
||||||
|
# function! Tags__sink (line)
|
||||||
|
# " 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
|
# scm
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'tpope/vim-fugitive'
|
repo = 'tpope/vim-fugitive'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'tpope/vim-rhubarb'
|
repo = 'tpope/vim-rhubarb'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'tommcdo/vim-fubitive'
|
repo = 'tommcdo/vim-fubitive'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
@@ -144,6 +338,7 @@ hook_add = '''
|
|||||||
" https://github.com/airblade/vim-gitgutter/issues/696
|
" https://github.com/airblade/vim-gitgutter/issues/696
|
||||||
autocmd ColorScheme * highlight! link SignColumn LineNr
|
autocmd ColorScheme * highlight! link SignColumn LineNr
|
||||||
'''
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
|
|
||||||
# local vimrc
|
# local vimrc
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
@@ -181,8 +376,15 @@ repo = 'LucHermitte/local_vimrc'
|
|||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'Shougo/deoplete.nvim'
|
repo = 'Shougo/deoplete.nvim'
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let g:deoplete#enable_at_startup = 0
|
let g:deoplete#enable_at_startup = 1
|
||||||
|
autocmd FileType TelescopePrompt call deoplete#custom#buffer_option('auto_complete', v:false)
|
||||||
'''
|
'''
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
|
lazy = false
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'Shougo/deoplete-lsp'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
|
lazy = false
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'roxma/nvim-yarp'
|
repo = 'roxma/nvim-yarp'
|
||||||
on_if = '!has("nvim")'
|
on_if = '!has("nvim")'
|
||||||
@@ -192,21 +394,18 @@ on_if = '!has("nvim")'
|
|||||||
|
|
||||||
# linting/compilation
|
# linting/compilation
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'w0rp/ale'
|
repo = 'dense-analysis/ale'
|
||||||
build = 'bash -c "cp -R ~/.vim/ale_linters ."'
|
# build = 'bash -c "cp -R ~/.vim/ale_linters ."'
|
||||||
on_ft = ['sh', 'vim']
|
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let g:ale_enabled = 0
|
let g:ale_enabled = 1
|
||||||
let g:ale_linters = {'haskell':[], 'c':['clang']}
|
" let g:ale_haskell_hie_executable = $HOME . '/.ghcup/bin/haskell-language-server-wrapper'
|
||||||
" let g:ale_linters = {'haskell':['ghc-mod', 'hdevtools', 'argon'], 'c':['clang']}
|
" let g:ale_linters = {'haskell':['hie'], 'c':[]}
|
||||||
" let g:ale_fixers = {
|
let g:ale_linters_explicit = 1
|
||||||
" \ 'haskell': ['brittany'],
|
|
||||||
" \}
|
|
||||||
let g:ale_haskell_hdevtools_options = "-g '-Wall' -g '-Wno-orphans'"
|
|
||||||
let g:ale_haskell_argon_error_level = 14
|
let g:ale_haskell_argon_error_level = 14
|
||||||
let g:ale_haskell_argon_warn_level = 10
|
let g:ale_haskell_argon_warn_level = 10
|
||||||
let g:ale_haskell_argon_info_level = 6
|
let g:ale_haskell_argon_info_level = 6
|
||||||
'''
|
'''
|
||||||
|
on_if = 'index(["sh", "vim"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
|
|
||||||
# LSP
|
# LSP
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
@@ -263,12 +462,19 @@ hook_add = '''
|
|||||||
let g:LanguageClient_loggingFile = expand('~/LanguageClient.log')
|
let g:LanguageClient_loggingFile = expand('~/LanguageClient.log')
|
||||||
let g:LanguageClient_serverStderr = expand('~/LanguageServer.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 = {
|
let g:LanguageClient_serverCommands = {
|
||||||
\ 'haskell': ['haskell-language-server-wrapper', '--lsp', '--logfile', $HOME.'/hls-server.log'],
|
\ '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']
|
||||||
\ }
|
\ }
|
||||||
'''
|
'''
|
||||||
|
on_if = '!has("nvim")'
|
||||||
#[[plugins]]
|
#[[plugins]]
|
||||||
#repo = 'prabirshrestha/vim-lsp'
|
#repo = 'prabirshrestha/vim-lsp'
|
||||||
#hook_add = '''
|
#hook_add = '''
|
||||||
@@ -310,7 +516,6 @@ hook_add = '''
|
|||||||
# multi language
|
# multi language
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'luochen1990/rainbow'
|
repo = 'luochen1990/rainbow'
|
||||||
on_ft = ['clojure', 'haskell', 'python']
|
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let g:rainbow_conf = {
|
let g:rainbow_conf = {
|
||||||
\ 'guifgs': ['#DC322F', 'royalblue3', 'darkorange3', 'seagreen3'],
|
\ 'guifgs': ['#DC322F', 'royalblue3', 'darkorange3', 'seagreen3'],
|
||||||
@@ -318,14 +523,14 @@ hook_add = '''
|
|||||||
\}
|
\}
|
||||||
let g:rainbow_active = 1
|
let g:rainbow_active = 1
|
||||||
'''
|
'''
|
||||||
|
on_if = 'index(["clojure", "haskell", "python"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
|
|
||||||
# haskell
|
# haskell
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'neovimhaskell/haskell-vim'
|
repo = 'neovimhaskell/haskell-vim'
|
||||||
on_ft = ['haskell', 'cabal']
|
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let g:haskell_classic_highlighting = 1
|
let g:haskell_classic_highlighting = 1
|
||||||
let g:haskell_indent_disable = 0
|
let g:haskell_indent_disable = 1
|
||||||
" let g:haskell_enable_quantification = 1
|
" let g:haskell_enable_quantification = 1
|
||||||
" let g:haskell_enable_recursivedo = 1
|
" let g:haskell_enable_recursivedo = 1
|
||||||
" let g:haskell_enable_arrowsyntax = 1
|
" let g:haskell_enable_arrowsyntax = 1
|
||||||
@@ -342,19 +547,20 @@ hook_add = '''
|
|||||||
let g:haskell_indent_guard = 4
|
let g:haskell_indent_guard = 4
|
||||||
" let g:haskell_disable_TH = 1
|
" let g:haskell_disable_TH = 1
|
||||||
'''
|
'''
|
||||||
|
on_if = 'index(["haskell", "cabal"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'Twinside/vim-hoogle'
|
repo = 'Twinside/vim-hoogle'
|
||||||
on_ft = ['haskell']
|
hook_source = '''
|
||||||
hook_add = '''
|
|
||||||
nnoremap <leader>ho :Hoogle<CR>
|
nnoremap <leader>ho :Hoogle<CR>
|
||||||
nnoremap <leader>hc :HoogleClose<CR>
|
nnoremap <leader>hc :HoogleClose<CR>
|
||||||
'''
|
'''
|
||||||
|
on_if = 'index(["haskell"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'alx741/vim-stylishask'
|
repo = 'alx741/vim-stylishask'
|
||||||
on_ft = ['haskell']
|
|
||||||
hook_add = '''
|
hook_add = '''
|
||||||
let g:stylishask_on_save = 0
|
let g:stylishask_on_save = 0
|
||||||
'''
|
'''
|
||||||
|
on_if = 'index(["haskell"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
|
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'fatih/vim-go'
|
repo = 'fatih/vim-go'
|
||||||
@@ -366,11 +572,6 @@ hook_post_source = 'GoInstallBinaries'
|
|||||||
repo = 'rust-lang/rust.vim'
|
repo = 'rust-lang/rust.vim'
|
||||||
on_ft = ['rust']
|
on_ft = ['rust']
|
||||||
|
|
||||||
# javascript
|
|
||||||
[[plugins]]
|
|
||||||
repo = 'pangloss/vim-javascript'
|
|
||||||
on_ft = ['javascript']
|
|
||||||
|
|
||||||
# python
|
# python
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'python-mode/python-mode'
|
repo = 'python-mode/python-mode'
|
||||||
@@ -386,23 +587,35 @@ repo = 'manicmaniac/coconut.vim'
|
|||||||
on_ft = ['python']
|
on_ft = ['python']
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'alfredodeza/pytest.vim'
|
repo = 'alfredodeza/pytest.vim'
|
||||||
on_ft = ['python']
|
on_if = 'index(["python"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'idanarye/vim-vebugger'
|
repo = 'idanarye/vim-vebugger'
|
||||||
on_ft = ['python']
|
on_if = 'index(["python"], &ft) >= 0 && !exists("g:vscode")'
|
||||||
|
|
||||||
# scala
|
# scala
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'derekwyatt/vim-scala'
|
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
|
# typescript
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'leafgarland/typescript-vim'
|
repo = 'leafgarland/typescript-vim'
|
||||||
on_ft = ['typescript']
|
on_ft = ['typescript', 'javascript']
|
||||||
|
#[[plugins]]
|
||||||
|
#repo = 'Quramy/tsuquyomi'
|
||||||
|
#on_ft = ['typescript', 'javascript']
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
repo = 'Quramy/tsuquyomi'
|
repo = 'prettier/vim-prettier'
|
||||||
on_ft = ['typescript']
|
on_ft = ['typescript', 'javascript']
|
||||||
|
build = 'npm install'
|
||||||
|
|
||||||
|
|
||||||
# color and beauty
|
# color and beauty
|
||||||
@@ -459,6 +672,7 @@ rtp = 'ScrollColor'
|
|||||||
name = 'bufonly'
|
name = 'bufonly'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
rtp = 'bufonly'
|
rtp = 'bufonly'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
name = 'colorschemedgrade'
|
name = 'colorschemedgrade'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
@@ -466,20 +680,22 @@ rtp = 'colorschemedegrade'
|
|||||||
[[plugins]]
|
[[plugins]]
|
||||||
name = 'exheres-syntax'
|
name = 'exheres-syntax'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
rtp = 'exheres-syntax-20160116'
|
rtp = 'exheres-syntax-20160115'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
name = 'fontzoom'
|
name = 'fontzoom'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
rtp = 'fontzoom'
|
rtp = 'fontzoom'
|
||||||
on_if = '!has("nvim")'
|
on_if = '!has("nvim")'
|
||||||
[[plugins]]
|
#[[plugins]]
|
||||||
name = 'fuzzyfinder'
|
#name = 'fuzzyfinder'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
#repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
rtp = 'fuzzyfinder'
|
#rtp = 'fuzzyfinder'
|
||||||
|
#on_if = '!exists("g:vscode")'
|
||||||
[[plugins]]
|
[[plugins]]
|
||||||
name = 'log'
|
name = 'log'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
rtp = 'log'
|
rtp = 'log'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
#[[plugins]]
|
#[[plugins]]
|
||||||
#repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
#repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
#rtp = 'paredit'
|
#rtp = 'paredit'
|
||||||
@@ -490,3 +706,143 @@ rtp = 'log'
|
|||||||
name = 'txtfmt'
|
name = 'txtfmt'
|
||||||
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
|
||||||
rtp = 'txtfmt'
|
rtp = 'txtfmt'
|
||||||
|
on_if = '!exists("g:vscode")'
|
||||||
|
|
||||||
|
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'williamboman/nvim-lsp-installer'
|
||||||
|
hook_add = '''
|
||||||
|
lua << EOF
|
||||||
|
require("nvim-lsp-installer").setup({
|
||||||
|
automatic_installation = false,
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
server_installed = "✓",
|
||||||
|
server_pending = "➜",
|
||||||
|
server_uninstalled = "✗"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
EOF
|
||||||
|
'''
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
lazy = true
|
||||||
|
depends = 'nvim-lspconfig'
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'neovim/nvim-lspconfig'
|
||||||
|
hook_add = '''
|
||||||
|
" https://github.com/nvim-lua/diagnostic-nvim/issues/29#issuecomment-819344193
|
||||||
|
" https://github.com/neovim/neovim/issues/12389
|
||||||
|
|
||||||
|
function! Diagnostic_open()
|
||||||
|
if len(filter(nvim_tabpage_list_wins(0), {k,v->nvim_win_get_config(v).relative!=""})) <= 1
|
||||||
|
lua vim.diagnostic.open_float({focusable = false})
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
lua << EOF
|
||||||
|
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
vim.cmd('autocmd CursorHold * call Diagnostic_open()')
|
||||||
|
end
|
||||||
|
require('lspconfig').hls.setup{
|
||||||
|
cmd = { vim.fs.normalize('~/.ghcup/bin/haskell-language-server-wrapper'), '--lsp', '+RTS', '--nonmoving-gc', '-RTS' },
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
haskell = {
|
||||||
|
formattingProvider = "brittany",
|
||||||
|
plugin = {
|
||||||
|
["ghcide-hover-and-symbols"] = { globalOn = true },
|
||||||
|
["ghcide-code-actions-imports-exports"] = { globalOn = true },
|
||||||
|
["ghcide-code-actions-type-signatures"] = { globalOn = false },
|
||||||
|
["ghcide-code-actions-bindings"] = { globalOn = false },
|
||||||
|
["ghcide-code-actions-fill-holes"] = { globalOn = false },
|
||||||
|
["ghcide-completions"] = { globalOn = true },
|
||||||
|
["ghcide-type-lenses"] = { globalOn = false },
|
||||||
|
pragmas = { globalOn = false },
|
||||||
|
tactics = { globalOn = false },
|
||||||
|
rename = { globalOn = false },
|
||||||
|
retrie = { globalOn = false },
|
||||||
|
callHierarchy = { globalOn = true },
|
||||||
|
class = { globalOn = false },
|
||||||
|
haddockComments = { globalOn = true },
|
||||||
|
eval = { globalOn = false },
|
||||||
|
importLens = { globalOn = false },
|
||||||
|
qualifyImportNames = { globalOn = true },
|
||||||
|
refineImports = { globalOn = true },
|
||||||
|
moduleName = { globalOn = false },
|
||||||
|
hlint = { globalOn = true },
|
||||||
|
splice = { globalOn = false },
|
||||||
|
alternateNumberFormat = { globalOn = false },
|
||||||
|
selectionRange = { globalOn = false },
|
||||||
|
changeTypeSignature = { globalOn = false }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('lspconfig').tsserver.setup{ on_attach = on_attach }
|
||||||
|
require('lspconfig').bashls.setup{ on_attach = on_attach }
|
||||||
|
require('lspconfig').jsonls.setup{ on_attach = on_attach }
|
||||||
|
require('lspconfig').vimls.setup{ on_attach = on_attach }
|
||||||
|
require('lspconfig').dockerls.setup{ on_attach = on_attach }
|
||||||
|
require('lspconfig').powershell_es.setup{ on_attach = on_attach, bundle_path = 'c:/w/PowerShellEditorServices', shell = 'pwsh' }
|
||||||
|
EOF
|
||||||
|
'''
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
lazy = true
|
||||||
|
|
||||||
|
[[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-file-browser.nvim'
|
||||||
|
lazy = false
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'nvim-telescope/telescope.nvim'
|
||||||
|
lazy = false
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
hook_add = '''
|
||||||
|
command! -nargs=* Rag :lua require('telescope.builtin').live_grep({ default_text = vim.fn.expand(<f-args>) })
|
||||||
|
'''
|
||||||
|
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'ldelossa/litee.nvim'
|
||||||
|
lazy = false
|
||||||
|
hook_add = '''
|
||||||
|
lua << EOF
|
||||||
|
require("litee.lib").setup({})
|
||||||
|
EOF
|
||||||
|
'''
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
|
||||||
|
[[plugins]]
|
||||||
|
repo = 'hasufell/litee-calltree.nvim'
|
||||||
|
lazy = false
|
||||||
|
hook_add = '''
|
||||||
|
lua << EOF
|
||||||
|
require("litee.calltree").setup({
|
||||||
|
map_resize_keys = false
|
||||||
|
})
|
||||||
|
EOF
|
||||||
|
'''
|
||||||
|
on_if = 'has("nvim") && !exists("g:vscode")'
|
||||||
|
|||||||
40
vimrc
40
vimrc
@@ -4,14 +4,20 @@
|
|||||||
set shortmess+=A
|
set shortmess+=A
|
||||||
|
|
||||||
let g:pymode_python = 'python3'
|
let g:pymode_python = 'python3'
|
||||||
|
let g:python_host_prog = '/usr/bin/python2'
|
||||||
|
let g:python3_host_prog = '/usr/bin/python3'
|
||||||
|
|
||||||
" plugin stuff
|
" plugin stuff
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
filetype indent on
|
|
||||||
|
|
||||||
set backspace=indent,eol,start " backspace through everything in insert mode
|
set backspace=indent,eol,start " backspace through everything in insert mode
|
||||||
set cmdheight=1
|
set cmdheight=1
|
||||||
|
|
||||||
|
" if has("gui_running")
|
||||||
|
" autocmd GUIEnter * set vb t_vb=
|
||||||
|
" endif
|
||||||
|
set belloff=all
|
||||||
|
|
||||||
set wildmenu
|
set wildmenu
|
||||||
" set wildmode=longest,list,full
|
" set wildmode=longest,list,full
|
||||||
|
|
||||||
@@ -24,10 +30,11 @@ endif
|
|||||||
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
|
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
|
||||||
|
|
||||||
let s:toml = $HOME . '/.vim/plugins.toml'
|
let s:toml = $HOME . '/.vim/plugins.toml'
|
||||||
|
let g:dein#lazy_rplugins = v:false
|
||||||
" Required:
|
" Required:
|
||||||
if dein#load_state($HOME . '/.cache/dein')
|
if dein#load_state($HOME . '/.cache/dein')
|
||||||
call dein#begin($HOME . '/.cache/dein', [$HOME . '/.vim/vimrc', $HOME . '/.vim/plugins.toml'])
|
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)
|
call dein#load_toml(s:toml)
|
||||||
|
|
||||||
" Let dein manage dein
|
" Let dein manage dein
|
||||||
@@ -38,9 +45,11 @@ if dein#load_state($HOME . '/.cache/dein')
|
|||||||
call dein#end()
|
call dein#end()
|
||||||
call dein#save_state()
|
call dein#save_state()
|
||||||
endif
|
endif
|
||||||
|
filetype plugin indent on
|
||||||
|
|
||||||
" ===== further plugin initialization and default config =====
|
" ===== further plugin initialization and default config =====
|
||||||
so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
|
so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
|
||||||
|
so ~/.vim/autoload/log-autocmds.vim
|
||||||
|
|
||||||
" lustyexplorer
|
" lustyexplorer
|
||||||
set hidden
|
set hidden
|
||||||
@@ -61,6 +70,7 @@ call CmdAlias('Nf', 'Neoformat')
|
|||||||
call CmdAlias('NF', 'Neoformat')
|
call CmdAlias('NF', 'Neoformat')
|
||||||
call CmdAlias('nf', 'Neoformat')
|
call CmdAlias('nf', 'Neoformat')
|
||||||
call CmdAlias('LS', 'LanguageClientStart')
|
call CmdAlias('LS', 'LanguageClientStart')
|
||||||
|
call CmdAlias('LspLog', 'lua vim.cmd("e"..vim.lsp.get_log_path())<CR>')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -84,7 +94,7 @@ set mouse=a
|
|||||||
set autoread
|
set autoread
|
||||||
set number
|
set number
|
||||||
set encoding=utf8
|
set encoding=utf8
|
||||||
set guifont=Monospace\ 14
|
set guifont=Hack\ Nerd\ Font\ Mono\ 16
|
||||||
set clipboard=unnamedplus
|
set clipboard=unnamedplus
|
||||||
set textwidth=0
|
set textwidth=0
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
@@ -195,6 +205,14 @@ fun! StripTrailingWhitespaces()
|
|||||||
call cursor(l, c)
|
call cursor(l, c)
|
||||||
endfun
|
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 +269,20 @@ function! ManCurrentWord()
|
|||||||
exe '!man 3 ' . word
|
exe '!man 3 ' . word
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
""""""""""""""""""""""""""""""
|
||||||
|
" Close preview after typing
|
||||||
|
""""""""""""""""""""""""""""""
|
||||||
|
autocmd WinEnter * call ClosePreviewWindow()
|
||||||
|
function ClosePreviewWindow()
|
||||||
|
if getwinvar(winnr("#"), "&pvw") == 1
|
||||||
|
pclose
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
set title
|
||||||
|
autocmd BufEnter * set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:h\")})%)%(\ %a%)
|
||||||
|
|
||||||
|
|
||||||
" vim:foldmethod=marker:foldlevel=0
|
" vim:foldmethod=marker:foldlevel=0
|
||||||
|
|||||||
Reference in New Issue
Block a user