" General settings
-" Attention: Must be run after plugsetup.vim
-" Trailing whitespace
-highlight default link BadWhitespace SpellCap
-
-" Setup BadWhitespace syntax match expressions.
-function SetBadWhitespaceSyntax()
- " Do not expose bad whitespace in help buffers or for man pages. Or, more
- " generally, if we open the file readonly.
- "if &ft != "help" && &ft != "man"
- if !&readonly
- " Make trailing whitespace be flagged as bad.
- syn match BadWhitespace /\s\+$/ containedin=ALL
- " Make space before tab be flagged as bad and vice versa
- syn match BadWhitespace / \+\t/ containedin=ALL
- syn match BadWhitespace /\t \+/ containedin=ALL
- endif
-endfunction
-
-" Make trailing whitespace be flagged as bad.
-au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
-
" termdebug split windows
let g:termdebug_wide = 1
let termdebugger = $HOME . '/.vim/gdb.sh'
" ctrl+d as EOF exits shells and the like. Add a keymap for the same here.
nnoremap <C-d> :q<cr>
-nnoremap <C-p> :Denite file/rec<cr>
-nnoremap <space>/ :Denite grep:.<cr>
-nnoremap <space>s :Denite buffer<cr>
-
nnoremap <C-space> pumvisible() ? "\<c-n>" : "\<tab>"
-nnoremap <F2> :NERDTreeToggle<cr>
+nnoremap <F2> :lua MiniFiles.open()<cr>
nnoremap <F3> :TagbarToggle<cr>
+nnoremap <F4> :lua MiniMap.toggle()<cr>
nmap <s-PageDown> :bn<CR>
nmap <s-PageUp> :bp<CR>
-map <a-c> <plug>NERDCommenterToggle
-
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
-" Start interactive EasyAlign in visual mode (e.g. vipga)
-vmap <Enter> <Plug>(EasyAlign)
-" Start interactive EasyAlign for a motion/text object (e.g. gaip)
-nmap ga <Plug>(EasyAlign)
-
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Some filetype-specific settings
-if has('nvim')
- Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}
- Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' }
-else
- Plug 'Shougo/deoplete.nvim'
- Plug 'Shougo/denite.nvim'
-
- Plug 'roxma/nvim-yarp'
- Plug 'roxma/vim-hug-neovim-rpc'
-endif
-
" java extension to deoplete
Plug 'artur-shaik/vim-javacomplete2', {'for': 'java'}
Plug 'shuber2/vim-syntax-easychair2'
-Plug 'mhinz/vim-signify'
-Plug 'tpope/vim-fugitive'
Plug 'gko/vim-coloresque'
Plug 'vimwiki/vimwiki'
call neomake#configure#automake('nw', 1000)
endif
- " Speedup deoplete startup time, see deoplete FAQ
- let g:python3_host_prog = '/usr/bin/python3'
- " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
- let g:deoplete#enable_at_startup = 0
- call deoplete#custom#option({
- \ 'smart_case' : v:true,
- \ 'auto_refresh_delay' : 100,
- \ })
- au InsertEnter * call deoplete#enable()
-
- " The denite settings are largely stolen from spacevim
- let s:denite_options = {
- \ 'default' : {
- \ 'winheight' : 15,
- \ 'mode' : 'insert',
- \ 'start_filter' : 1,
- \ 'quit' : 1,
- \ 'highlight_matched_char' : 'MoreMsg',
- \ 'highlight_matched_range' : 'MoreMsg',
- \ 'direction': 'rightbelow',
- \ }}
-
- augroup spacevim_layer_denite
- autocmd!
- autocmd FileType denite call s:denite_my_settings()
- augroup END
-
- function! s:denite_my_settings() abort
- nnoremap <silent><buffer><expr> i
- \ denite#do_map('open_filter_buffer')
- nnoremap <silent><buffer><expr> '
- \ denite#do_map('toggle_select').'j'
- nnoremap <silent><buffer><expr> q
- \ denite#do_map('quit')
- nnoremap <silent><buffer><expr> <C-t>
- \ denite#do_map('do_action', 'tabopen')
- nnoremap <silent><buffer><expr> <C-v>
- \ denite#do_map('do_action', 'vsplit')
- nnoremap <silent><buffer><expr> <C-s>
- \ denite#do_map('do_action', 'split')
- nnoremap <silent><buffer><expr> <CR>
- \ denite#do_map('do_action')
- nnoremap <silent><buffer><expr> p
- \ denite#do_map('do_action', 'preview')
- nnoremap <silent><buffer><Tab> j
- nnoremap <silent><buffer><S-Tab> k
- endfunction
-
- " FIND and GREP COMMANDS
- if executable('rg')
- " Ripgrep command on grep source
- call denite#custom#var('grep', 'command', ['rg'])
- call denite#custom#var('grep', 'default_opts',
- \ ['--vimgrep', '--no-heading'])
- call denite#custom#var('grep', 'recursive_opts', [])
- call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
- call denite#custom#var('grep', 'separator', ['--'])
- call denite#custom#var('grep', 'final_opts', [])
- endif
-
- let s:insert_mode_mappings = [
- \ ['jk', '<denite:enter_mode:normal>', 'noremap'],
- \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
- \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
- \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
- \ ['<Esc>', '<denite:enter_mode:normal>', 'noremap'],
- \ ['<C-N>', '<denite:assign_next_matched_text>', 'noremap'],
- \ ['<C-P>', '<denite:assign_previous_matched_text>', 'noremap'],
- \ ['<Up>', '<denite:assign_previous_text>', 'noremap'],
- \ ['<Down>', '<denite:assign_next_text>', 'noremap'],
- \ ['<C-Y>', '<denite:redraw>', 'noremap'],
- \ ]
-
- let s:normal_mode_mappings = [
- \ ["'", '<denite:toggle_select_down>', 'noremap'],
- \ ['<C-n>', '<denite:jump_to_next_source>', 'noremap'],
- \ ['<C-p>', '<denite:jump_to_previous_source>', 'noremap'],
- \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['gg', '<denite:move_to_first_line>', 'noremap'],
- \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
- \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
- \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
- \ ['q', '<denite:quit>', 'noremap'],
- \ ['r', '<denite:redraw>', 'noremap'],
- \ ]
-
- " Have deoplete completion for vimtex (e.g., bibtex entries)
- au Filetype tex call deoplete#custom#var('omni', 'input_patterns', {
- \ 'tex': g:vimtex#re#deoplete })
if has('nvim-0.5')
set foldexpr=nvim_treesitter#foldexpr()
-lua <<EOF
+ lua <<EOF
require'nvim-treesitter.configs'.setup {
-- one of "all"
ensure_installed = "all",
au FileType c,cpp,objc,javascript,java,typescript,protobuf,cuda,vala
\ nmap <buffer><leader>cf :ClangFormat<CR>
augroup END
-
endfunction
"Plug 'chikamichi/mediawiki.vim'
-function PluginsLocalConfig()
+function PluginsConfigLocal()
" Reduce load on memory by updating one plugin at a time
"let g:plug_threads = 1
" Conditional loading does not work, see github issue #823
Plug 'ludovicchabant/vim-gutentags'
-"Plug 'vim-scripts/Conque-GDB', {'for': ['c', 'cpp', 'objc']}
Plug 'editorconfig/editorconfig-vim'
Plug 'embear/vim-localvimrc'
Plug 'airblade/vim-rooter'
-Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeToggle'}
Plug 'plasticboy/vim-markdown', {'for': 'markdown'}
Plug 'lvht/tagbar-markdown', {'for': 'markdown'}
Plug 'vim-scripts/loremipsum', {'on': 'Loremipsum'}
-Plug 'ggandor/leap.nvim'
function PluginsConfigMidi()
let g:localvimrc_persistent = 1
let g:vim_markdown_auto_insert_bullets = 0
let g:calendar_monday = 1
-
- if has('nvim-0.5')
-lua <<EOF
- require('leap').set_default_keymaps()
-EOF
- endif
endfunction
Plug 'vim-airline/vim-airline'
Plug 'gruvbox-community/gruvbox'
-Plug 'liuchengxu/vim-which-key'
Plug 'benknoble/vim-auto-origami'
-Plug 'scrooloose/nerdcommenter'
-Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
-
Plug 'roryokane/detectindent'
" This plugin cannot be conditionally loaded, see github issue #18
Plug 'derekwyatt/vim-fswitch' ", {'for': ['c', 'cpp', 'objc']}
-Plug 'godlygeek/tabular'
-Plug 'junegunn/vim-easy-align'
-
Plug 'thinca/vim-fontzoom'
Plug 'lambdalisue/vim-manpager'
Plug 'nfnty/vim-nftables'
+if has('nvim')
+
+ Plug 'echasnovski/mini.nvim'", { 'branch': 'stable' }
+endif
function PluginsConfigMini()
endif
colorscheme gruvbox
- " let NERDTreeWinPos="right"
- let NERDTreeHijackNetrw=0
- let NERDTreeWinSize=22
- let NERDTreeQuitOnOpen=1
- "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
-
let g:startify_files_number = 5
let g:startify_session_persistence = 1
let g:startify_lists = [
let g:mapleader = "\<Space>"
let g:maplocalleader = ','
- nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
- nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>
- vnoremap <silent> <leader> :<c-u>WhichKeyVisual '<Space>'<CR>
- vnoremap <silent> <localleader> :<c-u>WhichKeyVisual ','<CR>
-
- let g:which_key_map = {}
- au VimEnter * call which_key#register('<Space>', 'g:which_key_map')
- let g:which_key_map.b = {
- \ 'name': '+buffer',
- \ '1': ['b1', 'buffer 1'],
- \ '2': ['b2', 'buffer 2'],
- \ 'd': ['bd', 'delete-buffer'],
- \ 'f': ['bfirst', 'first-buffer'],
- \ 'h': ['Startify', 'home-buffer'],
- \ 'l': ['blast', 'last-buffer'],
- \ 'n': ['bnext', 'next-buffer'],
- \ 'p': ['bprevious', 'previous-buffer'],
- \ }
+
+ if has('nvim-0.7')
+ lua <<EOF
+
+ require('mini.align').setup()
+ require('mini.ai').setup()
+ require('mini.bracketed').setup()
+ require('mini.bufremove').setup()
+ require('mini.comment').setup()
+ require('mini.completion').setup({delay = {completion = 500}})
+ require('mini.cursorword').setup()
+ require('mini.diff').setup()
+ require('mini.files').setup()
+ require('mini.fuzzy').setup()
+ require('mini.icons').setup()
+ require('mini.git').setup()
+ require('mini.jump2d').setup()
+ require('mini.map').setup()
+ require('mini.move').setup()
+ require('mini.notify').setup()
+ require('mini.operators').setup()
+ require('mini.pick').setup()
+ require('mini.sessions').setup()
+ require('mini.splitjoin').setup()
+ require('mini.surround').setup()
+ require('mini.trailspace').setup()
+EOF
+ endif
+
+ if has('nvim-0.9')
+ lua <<EOF
+
+ local miniclue = require('mini.clue')
+ miniclue.setup({
+ triggers = {
+ -- Leader triggers
+ { mode = 'n', keys = '<Leader>' },
+ { mode = 'x', keys = '<Leader>' },
+
+ -- Built-in completion
+ { mode = 'i', keys = '<C-x>' },
+
+ -- `g` key
+ { mode = 'n', keys = 'g' },
+ { mode = 'x', keys = 'g' },
+
+ -- Marks
+ { mode = 'n', keys = "'" },
+ { mode = 'n', keys = '`' },
+ { mode = 'x', keys = "'" },
+ { mode = 'x', keys = '`' },
+
+ -- Registers
+ { mode = 'n', keys = '"' },
+ { mode = 'x', keys = '"' },
+ { mode = 'i', keys = '<C-r>' },
+ { mode = 'c', keys = '<C-r>' },
+
+ -- Window commands
+ { mode = 'n', keys = '<C-w>' },
+
+ -- `z` key
+ { mode = 'n', keys = 'z' },
+ { mode = 'x', keys = 'z' },
+ },
+
+ clues = {
+ -- Enhance this by adding descriptions for <Leader> mapping groups
+ miniclue.gen_clues.builtin_completion(),
+ miniclue.gen_clues.g(),
+ miniclue.gen_clues.marks(),
+ miniclue.gen_clues.registers(),
+ miniclue.gen_clues.windows(),
+ miniclue.gen_clues.z(),
+ },
+ })
+EOF
+ endif
endfunction