plugins: Change easychair2 url master
authorStefan Huber <shuber@sthu.org>
Mon, 8 Jan 2024 14:30:55 +0000 (15:30 +0100)
committerStefan Huber <shuber@sthu.org>
Mon, 8 Jan 2024 14:30:55 +0000 (15:30 +0100)
19 files changed:
.gitignore
README.md
after/syntax/json.vim [new file with mode: 0644]
ftdetect/dis.vim [new file with mode: 0644]
ftplugin/dis.vim [new file with mode: 0644]
gvimrc
init-local.vim.example [deleted file]
init.vim
install.sh
keymaps.vim
macros.vim
neosnippets/gitcommit.snip
plugins-local.vim.example
plugins-noroot-nolowendbox.vim [new file with mode: 0644]
plugins-noroot.vim [new file with mode: 0644]
plugins.vim
plugsetup.vim
syntax/dis.vim [new file with mode: 0644]
vimspector-config/vimspector.json [new file with mode: 0644]

index 48a443eba405a85a4b7dcc096e2b701fbf28c0f1..005ee09d06d18e015ffae473f0479751e63e7200 100644 (file)
@@ -1,8 +1,12 @@
-plugged
+*.swp
+.netrwhist
 init-local.vim
 keymaps-local.vim
 macros-local.vim
-plugins-local.vim
-*.swp
 neosnippets/mail.snip
+plug-snapshot-*
+plugged
+plugins-local.vim
 spell/
+tags
+vimspector-config/gadgets
index fef6bdc6e1e4949479ea09aaa4f26d019099c101..43f7882f5f5e11bdf7e5461016a4233120182982 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,12 +1,5 @@
 # A modular vim configuration
 
-This is my personal vim configuration that is partly inspired by
-[SpaceVim](https://spacevim.org/). It is compatible to vim, gvim (8.0+) and
-neovim (0.2+). The configuration is split up into multiple files such that
-personal customization is separated from boilerplate code.
-
-![A demo screenshot](https://www.sthu.org/code/codesnippets/img/vimconf-start-plugin.png)
-
 
 <div class="hideonwebsite">
 This repository is a replication of the repository <a
@@ -15,6 +8,40 @@ href="https://www.sthu.org/code/codesnippets/vimconf.html">website</a> gives
 further details and more screenshots.
 </div>
 
+
+This is my personal vim configuration. The [git
+repo](https://git.sthu.org/?p=vimconf.git;a=summary) of this configuration is
+under constant flux, however, it should be compatible with (g)vim (8.0+) and
+neovim (0.2+), yet some features are only available with newer versions.
+
+![A demo screenshot](https://www.sthu.org/code/codesnippets/img/vimconf-startify.png)
+
+
+## Flavors on different machines
+
+I would like to use this configuration on a large variety of machines with
+different needs. To accommodate for this, the configuration is split up into
+multiple files and a different set of plugins is used:
+
+- In any case, the plugin set in `plugins.vim` is loaded.
+- If run as non-root user, an additional plugin set in `plugins-noroot.vim` is
+  loaded.
+- If run on a no-low-end-box, an additional plugin set in
+  `plugins-noroot-nolowendbox.vim` is loaded. A low-end box is indicated by the
+  existence of the file `lowendbox`, e.g., on my Raspberry Pi installations.
+- Also, if `plugins-local.vim` exists, this plugin set is loaded, too. For
+  instance, on one machine I have gnupg and corresponding vim plugins
+  configured.
+
+Similar to `plugins-local.vim`, also the following files are sourced if
+existent:
+
+  - `macros-local.vim`
+  - `keymaps-local.vim`
+  - `init-local.vim`
+
+Example files are shipped with the repository.
+
 ## Installation
 
 ### Requirements
@@ -57,20 +84,6 @@ This install script creates backups of existing configuration files (e.g.,
 `~/.vimrc`) and then creates symlinks to configuration files in `~/.vim`.
 
 
-## Specialization for local machines
-
-I personally would like to have the same vim configuration on all my user
-accounts. Still, on certain machines I would like to personalize and specialize
-the configuration. The following files are sourced if existent:
-
-  - plugins-local.vim
-  - macros-local.vim
-  - keymaps-local.vim
-  - init-local.vim
-
-Example files are shipped with the repository.
-
-
 ## Terminal color settings
 
 For consistent background colors you may change the background colors of your
diff --git a/after/syntax/json.vim b/after/syntax/json.vim
new file mode 100644 (file)
index 0000000..6db6a82
--- /dev/null
@@ -0,0 +1,4 @@
+syn region jsonComment start="/\*" end="\*/"
+syn region jsonComment start="//" end="$"
+hi link jsonCommentError Comment
+hi link jsonComment Comment
diff --git a/ftdetect/dis.vim b/ftdetect/dis.vim
new file mode 100644 (file)
index 0000000..1d3f669
--- /dev/null
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.dis* set filetype=dis
diff --git a/ftplugin/dis.vim b/ftplugin/dis.vim
new file mode 100644 (file)
index 0000000..0ae4f60
--- /dev/null
@@ -0,0 +1,6 @@
+if exists("b:did_ftplugin")
+    finish
+endif
+let b:did_ftplugin=1
+
+set ts=4
diff --git a/gvimrc b/gvimrc
index 1956f8b839b5797d0d1fe6fd3ccf08829cfcbec0..3782ff88eb6a3e6e3cca3ed71234751e1d79b84a 100644 (file)
--- a/gvimrc
+++ b/gvimrc
@@ -1,6 +1,6 @@
 set columns=100
 set lines=53
 
-set guifont=Hack\ NF\ 9,Hack\ 9,Liberation\ Mono\ for\ Powerline\ 10,DejaVu\ Sans\ Mono\ 10,Monospace\ 10
+set guifont=JetBrainsMono\ NF\ 9,Hack\ NF\ 9,Hack\ 9,DejaVu\ Sans\ Mono\ 10,Monospace\ 10
 
 set mousehide
diff --git a/init-local.vim.example b/init-local.vim.example
deleted file mode 100644 (file)
index 155438e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-" Do not show diagnostic window of vim-clang
-let g:clang_diagsopt = ''
-
-let g:ConqueTerm_StartMessages = 0
-
-" Reduce load on memory by updating one plugin at a time
-"let g:plug_threads = 1
-
-" Configuration for youcompleteme, if not using vim-clang.
-"let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
-"let g:ycm_confirm_extra_conf = 0
-"let g:ycm_min_num_of_chars_for_completion = 2
-"let g:ycm_collect_identifiers_from_tags_files = 1
-"let g:ycm_autoclose_preview_window_after_completion = 1
-"let g:ycm_key_list_select_completion = ['<Down>']
-"nnoremap <buffer> <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
-"let g:ycm_filetype_whitelist = { 'c' : 1, 'cpp' : 1, 'cs' : 1, 'objc' : 1, 'java' : 1, 'python' : 1 }
-
-" Some terminals, like konsole, cause weired symbols (e.g., q) printed due to
-" broken cursor-shape termcodes.
-if has('nvim')
-    set guicursor=
-    " Workaround some broken plugins which set guicursor indiscriminately.
-    au OptionSet guicursor noautocmd set guicursor=
-end
-
-" vim:ft=vim
index 86f93b3da6befc9866c02fbf7e6f6bb0299d5f6b..9700a32330881a913e40b041892b1ba2d98235f7 100644 (file)
--- a/init.vim
+++ b/init.vim
@@ -16,6 +16,9 @@ set fillchars=vert:│,fold:\
 set listchars=tab:»­,trail:·,eol:$
 set virtualedit=block
 
+" use filetype.lua and do not use filetype.vim for >=neovim-0.7.2
+let g:do_filetype_lua = 1
+let g:did_load_filetypes = 0
 filetype plugin indent on
 
 set tabstop=4
@@ -36,112 +39,25 @@ set colorcolumn=+1
 set mouse=a
 set wildmenu
 set wildmode=longest,list:full
+set showcmd
 
 set tabpagemax=100
 
-syntax on
-
-" Load some macros
-runtime macros.vim
-
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Some global plugin settings
-
-" Disable devicons on linux terminal
-if $TERM == 'linux'
-    let g:enable_plugin_devicons=0
-" Enable loading of devicons on all others
-else
-    let g:enable_plugin_devicons=1
-endif
-
-runtime plugsetup.vim
-
-let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
-
-" Some preferences for indent detection
-let g:detectindent_min_indent = 2
-let g:detectindent_max_indent = 4
-let g:detectindent_preferred_indent = 4
-
-" 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()
-
-let g:airline_powerline_fonts=1
-let g:airline#extensions#tabline#enabled=1
-let g:airline#extensions#branch#enabled=1
-
-let g:gruvbox_contrast_light='hard'
-let g:gruvbox_contrast_dark='hard'
-set bg=dark
-
-if &term =~ 'linux'
-    let g:gruvbox_termcolors=16
-else
-    " Setting termguicolors has two implications:
-    " - Breaks colors for some versions of mosh, but not if tmux is used on top of
-    "   mosh. See https://github.com/mobile-shell/mosh/issues/928
-    set termguicolors
-    let g:gruvbox_italic = 1
+if has('nvim-0.7')
+  set laststatus=3
 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:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
-let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
+syntax on
 
-" Taken from neomake
-if OnBattery()
-  call neomake#configure#automake('w')
+if filereadable($HOME . '/.vim/lowendbox')
+    let g:lowendbox = 1
 else
-  call neomake#configure#automake('nw', 1000)
+    let g:lowendbox = 0
 endif
 
-let g:clang_compilation_database = '.'
-
-" 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()
-
-"augroup pencil
-  "au!
-  "au FileType markdown,mkd call pencil#init()
-  "au FileType text         call pencil#init()
-  "au FileType mail         call pencil#init()
-  "au FileType tex          call pencil#init()
-"augroup END
-
-let g:vim_markdown_frontmatter=1
-let g:vim_markdown_math=1
+runtime macros.vim
+runtime keymaps.vim
+runtime plugsetup.vim
 
 
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -165,16 +81,6 @@ au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
 " Line wrap crippled with numbers shown
 au Filetype man setlocal nonumber
 
-" Minimum indenting for source code
-au FileType java,cpp,c,cs let g:detectindent_min_indent = 4
-" Consider using localvimrc config file or editorconfig instead
-"au BufReadPost *.java :DetectIndent
-
-au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
-au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
-
-au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
-au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
 
 au FileType cpp,c packadd termdebug
@@ -184,133 +90,36 @@ augroup autofoldcolumn
   au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
 augroup END
 
+
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Some plugin-specific settings
-
-let g:localvimrc_persistent = 1
-
-let g:fastfold_minlines = 0
-
-au FileType markdown call RagtagInit()
-
-let g:detectspelllang_langs = {}
-let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
-au FileType mail let g:VimMailSpellLangs=['de', 'en']
-
-:let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
-      \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
-      \ ['CANCELED(c)']]
-
-let g:vimwiki_list = [{'path': '~/.vimwiki/',
-      \ 'template_path': '~/.vim/vimwiki/templates',
-      \ 'template_default': 'default',
-      \ 'template_ext': '.html'}]
-let g:vimwiki_global_ext = 0
-
-" Java completion
-au FileType java setlocal omnifunc=javacomplete#Complete
-au FileType java JCEnable
-
-let g:VimMailContactsProvider=['khard']
-let g:VimMailContactsCommands={
-    \'khard':
-    \{ 'query' : "khard email --parsable --search-in-source-files",
-        \'sync': "/bin/true"}
-  \}
-
-let g:vimtex_fold_enabled = 1
-let g:vimtex_fold_levelmarker = '➜'
-
-" 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
+" General settings
 
-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
+" 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
 
-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'],
-      \ ]
+" 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'
 
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-runtime keymaps.vim
 
 if filereadable($HOME . '/.vim/init-local.vim')
   source ~/.vim/init-local.vim
index d50c6d9b8a46f5601b239f5c698c2eb517f05ea5..4d7ec01a2aa14f7bd5d17983f7484120ad82a59a 100755 (executable)
@@ -51,6 +51,7 @@ check_requirements()
     check_prog curl
     check_prog git
     check_vim +python3
+    check_vim +lua
     check_py3 neovim
     check_font "Hack NF"
 }
@@ -83,7 +84,7 @@ start the plugin provided colorscheme is not available yet.
 
 Add this line to your shell configuration, e.g., ~/.profile, to
 use vim as man pager:
-  export MANPAGER=\"view -c MANPAGER -\"
+  export MANPAGER=\"vi -c ASMANPAGER -\"
 EOF
 }
 
index 883b3e00eac93e837ba1a748edc13dc61c7fdee3..38f7774ee4d6a38379edc9f0e8f66e243c19337b 100644 (file)
@@ -1,6 +1,26 @@
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " Global settings
 
+if has('clipboard')
+    " Use + or * registers
+    if has('unnamedplus')
+        set clipboard+=unnamedplus
+    else
+        set clipboard+=unnamed
+    endif
+
+    " Ordinary ctrl+{c,x,v} using system clipboard register +. We use autocmd to
+    " override plugin keymaps.
+    "autocmd VimEnter * vnoremap <C-c> "+y
+    "autocmd VimEnter * vnoremap <C-x> "+x
+    " Is performed by S+Ins
+    "autocmd VimEnter * nnoremap <C-v> "+p
+    "autocmd VimEnter * inoremap <C-v> <c-r>+
+endif
+
+" 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>
@@ -30,11 +50,26 @@ nmap ga <Plug>(EasyAlign)
 
 au Filetype gnuplot map <buffer> <F5> :call OpenIn("gnuplot -persist") <CR>
 
-au Filetype c,cpp,objc map <buffer> <F11> :vsplit<CR>:FSRight<CR>
-au Filetype c,cpp,objc map <buffer> <S-F11> :FSHere<CR>
+" Performs a vertial split and a FSHere. For a header file the split is
+" performed to the left, for an implementation file to the right.
+function FSvsplit()
+    " We split to the right on header files
+    if match(expand('%:e'), 'h.*') >= 0
+        execute ':leftabove vsplit'
+    else
+        execute ':rightbelow vsplit'
+    endif
+
+    execute ':FSHere'
+endfunction
+
+au Filetype c,cpp,objc map <buffer> <F12> :call FSvsplit()<CR>
+" Terminal-based vi report S-F12 as F24
+au Filetype c,cpp,objc map <buffer> <S-F12> :FSHere<CR>
+au Filetype c,cpp,objc map <buffer> <F24> :FSHere<CR>
 
 au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
-au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
+au Filetype asciidoc,asciidoctor map <buffer> <F5> :call RunAsciidoc()<CR>
 
 " See https://github.com/artur-shaik/vim-Javacomplete2
 " <C-j>ji <leader>ji
@@ -56,7 +91,6 @@ au FileType java imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
 
 
 
-
 if filereadable($HOME . '/.vim/keymaps-local.vim')
   source ~/.vim/keymaps-local.vim
 endif
index b33bf4da65992365e37c3886d23716cc993d43ce..1da3dae9c56080df7f1cdc01545f006bef4759ac 100644 (file)
@@ -78,9 +78,12 @@ endfunction
 
 
 function InsertIncludeGuardsWithoutEndif()
-  let gatename = substitute(expand("%:t"), "\\.", "_", "g") . '_' . strpart(system('pwgen -c 16 1'), 0, 16)
-  execute "normal! i#ifndef " . gatename
-  execute "normal!   o#define " . gatename
+  " Build name of guard: Take filename, replace some chars by _ and
+  " prepend a random sequence to make guard robust against file name
+  " collisions.
+  let guardname = substitute(expand("%:t"), "[\\.-]", "_", "g") . '_' . strpart(system('pwgen -c 16 1'), 0, 16)
+  execute "normal! i#ifndef " . guardname
+  execute "normal! o#define " . guardname
 endfunction
 
 
@@ -109,6 +112,15 @@ endfunction
 
 function RunAsciidoctor()
   execute ":!asciidoctor " . @%
+  if executable("asciidoctor-pdf")
+    execute ":!asciidoctor-pdf " . @%
+  elseif executable("asciidoctor")
+    execute ":!asciidoctor " . @%
+  endif
+endfunction
+
+function RunAsciidoctorPdf()
+  execute ":!asciidoctor-pdf " . @%
 endfunction
 
 
@@ -126,7 +138,9 @@ endfunction
 
 
 function RunAsciidoc()
-  if executable("asciidoctor")
+  if executable("asciidoctor-pdf")
+    call RunAsciidoctorPdf()
+  elseif executable("asciidoctor")
     call RunAsciidoctor()
   else
     echo "No asciidoc implementation found."
index ed9ffe37711e6a37e183c276e867473c489d3341..dc6106c957a686a748eda65d00503ee7476a446a 100644 (file)
@@ -17,3 +17,7 @@ options head
 snippet acked-by
 options head
        Acked-by: ${1:authorname <mail>}
+snippet Ste-sthu
+       Stefan Huber <shuber@sthu.org>
+snippet Ste-fhs
+       Stefan Huber <stefan.huber@fh-salzburg.ac.at>
index c0be0eaf6dda50b9efc1993aa418ce241f5f2fae..49d6cdf64b45010d57336549ff08df4eb5bcf480 100644 (file)
@@ -1,8 +1,20 @@
 Plug 'jamessan/vim-gnupg'
 
-" An alternative to youcompleteme (ycm)
-Plug 'justmao945/vim-clang', {'for': ['c', 'cpp', 'objc']}
-
 "Plug 'kien/tabman.vim'
 
 "Plug 'chikamichi/mediawiki.vim'
+
+function PluginsLocalConfig()
+    " Reduce load on memory by updating one plugin at a time
+    "let g:plug_threads = 1
+
+    " Some terminals, like konsole, cause weired symbols (e.g., q) printed due to
+    " broken cursor-shape termcodes.
+    "if has('nvim')
+        "set guicursor=
+        " Workaround some broken plugins which set guicursor indiscriminately.
+        "au OptionSet guicursor noautocmd set guicursor=
+    "end
+endfunction
+
+" vim:ft=vim
diff --git a/plugins-noroot-nolowendbox.vim b/plugins-noroot-nolowendbox.vim
new file mode 100644 (file)
index 0000000..f442a5d
--- /dev/null
@@ -0,0 +1,314 @@
+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 'neomake/neomake'
+Plug 'puremourning/vimspector'
+
+Plug 'kana/vim-operator-user'
+Plug 'rhysd/vim-clang-format'
+Plug 'justmao945/vim-clang', {'for': ['c', 'cpp', 'objc']}
+
+" Prevent slow foling update, e.g., for vimtex
+Plug 'Konfekt/FastFold'
+Plug 'lervag/vimtex'
+
+Plug 'shuber2/vim-syntax-easychair2'
+
+Plug 'mhinz/vim-signify'
+Plug 'tpope/vim-fugitive'
+Plug 'gko/vim-coloresque'
+
+Plug 'vimwiki/vimwiki'
+Plug 'jceb/vim-orgmode', {'for': ['org']}
+
+Plug 'cakebaker/scss-syntax.vim', {'for': 'scss'}
+Plug 'hail2u/vim-css3-syntax', {'for': ['scss', 'css']}
+
+Plug 'https://gitlab.com/dbeniamine/vim-mail'
+Plug 'Konfekt/vim-DetectSpellLang', {'do': 'spell'}
+Plug 'dpelle/vim-LanguageTool'
+
+" Disable devicons on linux terminal
+if $TERM == 'linux'
+    let g:enable_plugin_devicons=0
+    " Enable loading of devicons on all others
+else
+    let g:enable_plugin_devicons=1
+endif
+
+Plug 'ryanoasis/vim-devicons', Cond(g:enable_plugin_devicons)
+Plug 'joom/latex-unicoder.vim'
+Plug 'chrisbra/unicode.vim'
+
+Plug 'sjl/splice.vim', {'on': 'SpliceInit'}
+
+" Costs a second startup time
+Plug 'dbeniamine/cheat.sh-vim', {'on': 'Cheat'}
+
+Plug 'sheerun/vim-polyglot'
+
+" neovim-0.4 has troubles with nvim-treesitter
+if has('nvim-0.5')
+    " neovim-0.7 works until v0.8.0
+    if has('nvim-0.9')
+        Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+    else
+        Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate', 'tag': 'v0.8.0'}
+    endif
+
+    Plug 'nvim-treesitter/nvim-treesitter-refactor', {'do': ':TSUpdate'}
+endif
+
+function PluginsNorootNolowendboxConfig()
+    let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
+    let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
+    let g:clang_compilation_database = '.'
+
+    " Taken from neomake
+    if OnBattery()
+        call neomake#configure#automake('w')
+    else
+        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
+        require'nvim-treesitter.configs'.setup {
+            -- one of "all"
+            ensure_installed = "all",
+            -- List of parsers to ignore installing
+            ignore_install = {},
+            -- Modules and its options go here
+            highlight = { enable = true },
+            -- Indentation is still quite buggy, e.g., for multi-line C comments
+            -- or for comments right after a preproc definition.
+            -- indent = { enable = true },
+            textobjects = { enable = true },
+            incremental_selection = {
+                enable = true,
+                keymaps = {
+                    init_selection = "gnn",
+                    node_incremental = "grn",
+                    scope_incremental = "grc",
+                    node_decremental = "grm",
+                },
+            },
+            refactor = {
+                highlight_definitions = { enable = true },
+                smart_rename = {
+                    enable = true,
+                    keymaps = { smart_rename = "grr" },
+                    },
+                navigation = {
+                    enable = true,
+                    keymaps = {
+                        goto_definition = "gnd",
+                        list_definitions = "gnD",
+                        list_definitions_toc = "gO",
+                        goto_next_usage = "<a-*>",
+                        goto_previous_usage = "<a-#>",
+                    },
+                },
+            },
+        }
+EOF
+    endif
+
+    let g:fastfold_minlines = 0
+
+    let g:detectspelllang_langs = {}
+    let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
+
+    " Try finding jar file. If it does not work, set cmd directly
+    let g:languagetool_jar='/snap/languagetool/current/usr/bin/languagetool-commandline.jar'
+    if !filereadable(g:languagetool_jar)
+        unlet! g:languagetool_jar
+        let g:languagetool_cmd='languagetool'
+    endif
+
+
+    au FileType mail let g:VimMailSpellLangs=['de', 'en']
+    let g:VimMailContactsProvider=['khard']
+    let g:VimMailContactsCommands={
+                \'khard':
+                \{ 'query' : "khard email --parsable --search-in-source-files",
+                \'sync': "/bin/true"}
+                \}
+
+    let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
+                \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
+                \ ['CANCELED(c)']]
+
+    let g:vimwiki_list = [{'path': '~/.vimwiki/',
+                \ 'template_path': '~/.vim/vimwiki/templates',
+                \ 'template_default': 'default',
+                \ 'template_ext': '.html'}]
+    let g:vimwiki_global_ext = 0
+
+
+    " Java completion
+    au FileType java setlocal omnifunc=javacomplete#Complete
+    au FileType java JCEnable
+
+    let g:vimtex_fold_enabled = 1
+    let g:vimtex_fold_levelmarker = '➜'
+    let g:vimtex_view_general_viewer = 'okular'
+    let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
+    let g:airline#extensions#vimtex#enabled = 1
+
+    au FileType c,cpp,objc,java,python packadd! vimspector
+    let g:vimspector_base_dir = expand('~/.vim/vimspector-config')
+    let g:vimspector_install_gadgets = [ 'debugpy', 'vscode-cpptools' ]
+    "let g:vimspector_enable_mappings = 'VISUAL_STUDIO'
+
+    function VimspectorRestartOrCreateConfig()
+        if !filereadable('.vimspector.json')
+            echo "Missing .vimspector.json, created one."
+            execute 'tabe .vimspector.json'
+        else
+            call vimspector#Restart()
+        endif
+    endfunction
+
+    nmap <leader>dc  <Plug>VimspectorContinue
+    nmap <leader>ds  <Plug>VimspectorStop
+    nmap <leader>dr  :call VimspectorRestartOrCreateConfig()<CR>
+    "nmap <leader>dr  :call vimspector#Restart()<CR>
+    nmap <leader>drr :call vimspector#Reset()<CR>
+    nmap <leader>dp  <Plug>VimspectorPause
+    nmap <leader>db  <Plug>VimspectorToggleBreakpoint
+    nmap <leader>dcb <Plug>VimspectorToggleConditionalBreakpoint
+    nmap <leader>dfb <Plug>VimspectorAddFunctionBreakpoint
+    nmap <leader>dtc <Plug>VimspectorRunToCursor
+    nmap <leader>do  <Plug>VimspectorStepOver
+    nmap <leader>di  <Plug>VimspectorStepInto
+    nmap <leader>dof <Plug>VimspectorStepOut
+    " for normal mode, the word under the cursor
+    nmap <Leader>de  <Plug>VimspectorBalloonEval
+    " for visual mode, the visually selected text
+    xmap <Leader>de  <Plug>VimspectorBalloonEval
+
+    au BufNewFile .vimspector.json read ~/.vim/vimspector-config/vimspector.json
+
+    " Do not show diagnostic window of vim-clang
+    let g:clang_diagsopt = ''
+
+    augroup ClangFormatSettings
+        au!
+        au FileType c,cpp,objc,javascript,java,typescript,protobuf,cuda,vala
+                    \ vmap <buffer><leader>cf <Plug>(operator-clang-format)
+        au FileType c,cpp,objc,javascript,java,typescript,protobuf,cuda,vala
+                    \ nmap <buffer><leader>cf :ClangFormat<CR>
+    augroup END
+
+endfunction
diff --git a/plugins-noroot.vim b/plugins-noroot.vim
new file mode 100644 (file)
index 0000000..81411f9
--- /dev/null
@@ -0,0 +1,73 @@
+Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'}
+
+" 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 'habamax/vim-asciidoctor', {'for': 'asciidoc'}
+
+Plug 'PProvost/vim-markdown-jekyll', {'for': 'markdown'}
+Plug 'tpope/vim-liquid', {'for': ['liquid', 'html', 'xml', 'markdown']}
+
+Plug 'tpope/vim-ragtag'
+
+Plug 'Shougo/neosnippet.vim'
+Plug 'Shougo/neosnippet-snippets'
+
+Plug 'tpope/vim-speeddating'
+Plug 'mattn/calendar-vim'
+
+Plug 'vim-scripts/loremipsum', {'on': 'Loremipsum'}
+
+Plug 'ggandor/leap.nvim'
+
+function PluginsNorootConfig()
+    let g:localvimrc_persistent = 1
+
+    let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
+
+    "augroup pencil
+      "au!
+      "au FileType markdown,mkd call pencil#init()
+      "au FileType text         call pencil#init()
+      "au FileType mail         call pencil#init()
+      "au FileType tex          call pencil#init()
+    "augroup END
+
+    let g:vim_markdown_frontmatter=1
+    let g:vim_markdown_math=1
+
+    au FileType markdown call RagtagInit()
+
+    " Generally disable gutentags, but enable for some filetypes
+    let g:gutentags_enabled = 0
+    au FileType c,cpp,objc,tex let g:gutentags_enabled = 1
+    " Make manually created tags files also root markers
+    let g:gutentags_project_root = ['tags']
+    let g:gutentags_cache_dir = expand('~/.cache/vim/ctags/')
+    " Do not automatically generate on browsing
+    let g:gutentags_generate_on_missing = 0
+    let g:gutentags_ctags_exclude_wildignore = 1
+    let g:gutentags_ctags_exclude = [
+                \'node_modules', '_build', 'build*', 'CMakeFiles', '.*cache*', 'venv',
+                \'*.md', '*.css', '*.html', '*.json', '*.xml', '*.xmls', '*.ui']
+
+    " Allow for reflow of bullet paragraphs
+    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
index a79fac1e780977df22082ebb29d38fe31ab8b6ec..66939e622131dafdff86b125b44b48433dc2451f 100644 (file)
 function! Cond(cond, ...)
-  let opts = get(a:000, 0, {})
-  return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
+    let opts = get(a:000, 0, {})
+    return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
 endfunction
 
 Plug 'mhinz/vim-startify'
-
-Plug 'editorconfig/editorconfig-vim'
-Plug 'embear/vim-localvimrc'
+Plug 'dstein64/vim-startuptime'
 
 Plug 'vim-airline/vim-airline'
 Plug 'gruvbox-community/gruvbox'
-
-Plug 'mhinz/vim-signify'
-Plug 'tpope/vim-fugitive'
-Plug 'airblade/vim-rooter'
+Plug 'liuchengxu/vim-which-key'
 
 Plug 'benknoble/vim-auto-origami'
-" Prevent slow foling update, e.g., for vimtex
-Plug 'Konfekt/FastFold'
 
 Plug 'scrooloose/nerdcommenter'
-
 Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
-Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeToggle'}
-
-Plug 'ryanoasis/vim-devicons', Cond(g:enable_plugin_devicons)
-
-Plug 'neomake/neomake'
-Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'}
-
-Plug 'plasticboy/vim-markdown', {'for': 'markdown'}
-Plug 'lvht/tagbar-markdown', {'for': 'markdown'}
-Plug 'habamax/vim-asciidoctor', {'for': 'asciidoc'}
-
-Plug 'PProvost/vim-markdown-jekyll', {'for': 'markdown'}
-Plug 'tpope/vim-liquid', {'for': ['liquid', 'html', 'xml', 'markdown']}
-
-Plug 'cakebaker/scss-syntax.vim', {'for': 'scss'}
-Plug 'hail2u/vim-css3-syntax', {'for': ['scss', 'css']}
-Plug 'ap/vim-css-color', {'for': ['scss', 'css']}
-
-Plug 'tpope/vim-ragtag'
-
-Plug 'lervag/vimtex', {'for': 'tex'}
 
-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 'Shougo/neosnippet.vim'
-Plug 'Shougo/neosnippet-snippets'
-
-Plug 'tpope/vim-speeddating'
-Plug 'jceb/vim-orgmode', {'for': ['org']}
-Plug 'vimwiki/vimwiki'
-Plug 'mattn/calendar-vim'
-
-Plug 'Konfekt/vim-DetectSpellLang', {'do': 'spell'}
 Plug 'roryokane/detectindent'
 
-Plug 'derekwyatt/vim-fswitch', {'for': ['c', 'cpp', 'objc']}
-Plug 'ludovicchabant/vim-gutentags', {'for': ['c', 'cpp', 'objc']}
-"Plug 'vim-scripts/Conque-GDB', {'for': ['c', 'cpp', 'objc']}
+" 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 'vim-scripts/loremipsum', {'on': 'Loremipsum'}
-
-Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'}
-
-Plug 'https://gitlab.com/dbeniamine/vim-mail'
-" Costs a second startup time
-Plug 'dbeniamine/cheat.sh-vim', {'on': 'Cheat'}
-
-Plug 'dstein64/vim-startuptime'
+Plug 'lambdalisue/vim-manpager'
 
 " Make . more useful after a plugin map
 Plug 'tpope/vim-repeat'
-
 Plug 'flwyd/vim-conjoin'
 
-Plug 'sjl/splice.vim', {'on': 'SpliceInit'}
+Plug 'nfnty/vim-nftables'
+
+
+function PluginsConfig()
+
+    " Some preferences for indent detection
+    let g:detectindent_min_indent = 2
+    let g:detectindent_max_indent = 4
+    let g:detectindent_preferred_indent = 4
+
+    " Minimum indenting for source code
+    au FileType c,cpp,objc,java,cs let g:detectindent_min_indent = 4
+    " Consider using localvimrc config file or editorconfig instead
+    "au BufReadPost *.java :DetectIndent
+
+    let g:airline_powerline_fonts=1
+    let g:airline#extensions#tabline#enabled=1
+    let g:airline#extensions#branch#enabled=1
+
+    let g:gruvbox_contrast_light='hard'
+    let g:gruvbox_contrast_dark='hard'
+    set bg=dark
+
+    if &term =~ 'linux'
+        let g:gruvbox_termcolors=16
+    else
+        " Setting termguicolors has two implications:
+        " - Breaks colors for some versions of mosh, but not if tmux is used on top of
+        "   mosh. See https://github.com/mobile-shell/mosh/issues/928
+        set termguicolors
+        let g:gruvbox_italic = 1
+    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 = [
+                \ { 'type': 'dir',       'header': ['   Recent files'] },
+                \ { 'type': 'sessions',  'header': ['   Saved sessions'] },
+                \ ]
+
+    if has('nvim')
+        let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
+        let g:startify_custom_header = [
+                    \ '',
+                    \ '        ╻ ╻   ╻   ┏┳┓',
+                    \ '   NEO  ┃┏┛   ┃   ┃┃┃',
+                    \ '        ┗┛    ╹   ╹ ╹  ' . verstr,
+                    \ '',
+                    \ ]
+    else
+        let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
+        let g:startify_custom_header = [
+                    \ '',
+                    \ '   ╻ ╻   ╻   ┏┳┓',
+                    \ '   ┃┏┛   ┃   ┃┃┃',
+                    \ '   ┗┛    ╹   ╹ ╹  ' . verstr,
+                    \ '',
+                    \ ]
+    endif
+
+    au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
+    au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
+    au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
+    au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
+
+    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'],
+      \ }
 
-Plug 'sheerun/vim-polyglot'
+endfunction
 
-if filereadable($HOME . '/.vim/plugins-local.vim')
-  source ~/.vim/plugins-local.vim
-endif
index ab7fa210c84997eda6a7f308e234c7cedcc17456..f47a045aecfecafe4de8fde09287bdbf31ac7d9f 100644 (file)
@@ -6,13 +6,46 @@ if empty(glob('~/.vim/autoload/plug.vim'))
   autocmd VimEnter * PlugInstall --sync | source ~/.vim/init.vim
 endif
 
+
 call plug#begin('~/.vim/plugged')
+
 source ~/.vim/plugins.vim
+
+" Load various conditinoal plugin sets
+if filereadable($HOME . '/.vim/plugins-local.vim')
+    source ~/.vim/plugins-local.vim
+endif
+
+if $USER != "root"
+    source ~/.vim/plugins-noroot.vim
+
+    if g:lowendbox == 0
+        source ~/.vim/plugins-noroot-nolowendbox.vim
+    endif
+endif
+
 call plug#end()
 
-"Automatically install missing plugins
-"https://github.com/junegunn/vim-plug/wiki/extra
-autocmd VimEnter *
-  \  if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
-  \|   PlugInstall --sync | q
-  \| endif
+
+" Call the config functions of the plugins
+call PluginsConfig()
+if filereadable($HOME . '/.vim/plugins-local.vim')
+    call PluginsLocalConfig()
+endif
+if $USER != "root"
+    call PluginsNorootConfig()
+    if g:lowendbox == 0
+        call PluginsNorootNolowendboxConfig()
+    endif
+endif
+
+
+function s:PostConfig()
+    "Automatically install missing plugins
+    "https://github.com/junegunn/vim-plug/wiki/extra
+    if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
+        PlugInstall --sync | q
+    endif
+endfunction
+
+autocmd VimEnter * call s:PostConfig()
diff --git a/syntax/dis.vim b/syntax/dis.vim
new file mode 100644 (file)
index 0000000..8da41dd
--- /dev/null
@@ -0,0 +1,119 @@
+" Vim syntax file
+" Language:     x86/x64 GNU Disassembler (objdump -d -Mintel)
+" Maintainer:   @shiracamus <shiracamus@gmail.com>
+" Last Change:  2013 Dec 30
+
+" For version 5.x: Clear all syntax items
+" For version 6.0 and later: Quit when a syntax file was already loaded
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+syn case ignore
+
+syn match disOffset     "[+-]"
+syn match disNumber     "[+-]\?\<0x[0-9a-f]\+\>" contains=disOffset
+syn match disNumber     "[+-]\?\<[0-9a-f]\+\>" contains=disOffset
+
+syn match disRegister   "\<[re]\?[abcd][xhl]\>"
+syn match disRegister   "\<[re]\?[sd]il\?\>"
+syn match disRegister   "\<[re]\?[sbi]pl\?\>"
+syn match disRegister   "\<r[0-9]\+[dwb]\?\>"
+syn match disRegister   "[^\t]\<[cdefgs]s\>"hs=s+1
+
+syn match disAt         "@"
+syn match disSection    " \.[a-z][a-z_\.-]*:"he=e-1
+syn match disSection    "@[a-z0-9_][a-z0-9_-]\+"hs=s+1 contains=disAt,disNumber
+
+" SH: Having a function name like "f" leads to labels like "<f>", which shall
+" not be matched as disNumber.
+"syn match disLabel      "<[a-z0-9_.][a-z0-9_.@+-]*>"hs=s+1,he=e-1 contains=disNumber,disSection
+syn match disLabel      "<[a-z0-9_.][a-z0-9_.@+-]*>"hs=s+1,he=e-1 contains=disSection
+syn match disHexDump    ":\t\([0-9a-f][0-9a-f][ \t]\)\+"hs=s+1
+
+syn match disError      "<internal disassembler error>"
+syn match disError      "(bad)"
+
+syn keyword disTodo     contained TODO
+
+syn region disComment   start="/\*" end="\*/" contains=disTodo
+syn match disComment    "[#;!|].*" contains=disLabel,disTodo
+syn match disStatement  "//.*" contains=cStatement
+
+syn match disSpecial    display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+syn region disString    start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=disSpecial
+syn region disString    start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=disSpecial
+
+syn match disFormat     ": \+file format "
+syn match disTitle      "^[^ ]\+: \+file format .*$" contains=disFormat
+
+syn match disMacro      "FWORD"
+syn match disMacro      "QWORD"
+syn match disMacro      "DWORD"
+syn match disMacro      "BYTE"
+syn match disMacro      "PTR"
+
+syn match disData       ".word"
+syn match disData       ".short"
+syn match disData       ".byte"
+
+" Opecode matched disNumber
+syn match disOpecode    "\<add "
+syn match disOpecode    "\<adc "
+syn match disOpecode    "\<dec "
+syn match disOpecode    "\<fadd "
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dis_syntax_inits")
+  if version < 508
+    let did_dis_syntax_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  " The default methods for highlighting.  Can be overridden later
+  " Comment
+  HiLink disComment     Comment
+  " Constant: String, Character, Number, Boolean, Float
+  HiLink disNumber      Number
+  HiLink disString      String
+  " Identifier: Function
+  HiLink disHexDump     Identifier
+  " Statement: Conditional, Repeat, Label, Operator, Keyword, Exception
+  HiLink disStatement  Statement
+  HiLink disLabel       Label
+  " PreProc: Include, Define, Macro, PreCondit
+  HiLink disData        Define
+  HiLink disMacro       Macro
+  " Type: StorageClass, Structure, Typedef
+  HiLink disRegister    StorageClass
+  HiLink disTitle       Typedef
+  " Special: SpecialChar, Tag, Delimiter, SpecialComment, Debug
+  HiLink disSpecial     SpecialChar
+  HiLink disSection     Special
+  " Underlined
+  " Ignore
+  " Error
+  HiLink disError       Error
+  " Todo
+  HiLink disTodo        Todo
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "dis"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ts=8 sts=4 sw=2
diff --git a/vimspector-config/vimspector.json b/vimspector-config/vimspector.json
new file mode 100644 (file)
index 0000000..c6a761a
--- /dev/null
@@ -0,0 +1,63 @@
+// This is from a template. Modify for your needs.
+{
+    "configurations": {
+        "Launch": {
+            "default": true,
+            "adapter": "vscode-cpptools",
+            "filetypes": [ "cpp", "c", "objc", "rust" ],
+            "configuration": {
+                "request": "launch",
+                "MIMode": "gdb",
+                "program": "${fileBasenameNoExtension}",
+                "args": [ ],
+                "environment": [ ],
+                "externalConsole": true,
+                "setupCommands": [
+                    {
+                        "description": "Enable pretty-printing for gdb",
+                        "text": "-enable-pretty-printing",
+                        "ignoreFailures": true
+                    }
+                ]
+            }
+        },
+        "Attach": {
+            "adapter": "vscode-cpptools",
+            "filetypes": [ "cpp", "c", "objc", "rust" ],
+            "configuration": {
+                "request": "attach",
+                "MIMode": "gdb",
+                "program": "${fileBasenameNoExtension}",
+                "setupCommands": [
+                    {
+                        "description": "Enable pretty-printing for gdb",
+                        "text": "-enable-pretty-printing",
+                        "ignoreFailures": true
+                    }
+                ]
+            }
+        },
+        "Python: Attach To Vim": {
+            "adapter": "multi-session",
+            "filetypes": [ "python" ],
+            "variables": {
+                "port": "5678",
+                "host": "localhost"
+            },
+            "configuration": {
+                "request": "attach"
+            }
+        },
+        "Python: Run current script": {
+            "default": true,
+            "adapter": "debugpy",
+            "filetypes": [ "python" ],
+            "configuration": {
+                "request": "launch",
+                "program": "${file}",
+                "args": [ "*${args:--update-gadget-config}" ],
+                "justMyCode#json": "${justMyCode:true}"
+            }
+        }
+    }
+}