vim/vimrc
Kenneth Benzie (Benie) c284486540 Make nvim :terminal more consistent with vim
Vim's :terminal feels much more ergonomic, adding various mappings to
make the experience more similar, mainly by adding a few `<C-w>`
mappings for the most common actions.

Additionally, disable vim-tmux-navigators default mappings and setup
both normal and terminal mode mappings for `<C-w>{h,j,k,l}` in addition
to the normal mode mappings for `<C-{h,j,j,l}>` to make the pane
switching experience more consistent across all buffer types.
2021-04-18 14:42:33 +01:00

192 lines
5.2 KiB
VimL

set encoding=utf-8
scriptencoding 'utf-8'
" Set leader to space
let g:mapleader = ' '
if has('autocmd')
filetype plugin indent on
endif
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
if exists('*minpac#init')
" When minpac is loaded define the Pack command to add packages.
command! -nargs=+ Pack call minpac#add(<args>)
else
" Otherwise define the Pack command to do nothing.
command! -nargs=+ Pack
endif
" Append work config to runtimepath and packpath.
set runtimepath+=~/.config/work
set packpath+=~/.config/work
" tabline.vim - sanely numbered tabs
Pack 'mkitt/tabline.vim'
" coc.nvim Conqueror of Completion
Pack 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = [
\ 'coc-clangd',
\ 'coc-cmake',
\ 'coc-css',
\ 'coc-html',
\ 'coc-json',
\ 'coc-marketplace',
\ 'coc-pyls',
\ 'coc-ultisnips',
\ 'coc-vimlsp',
\ 'coc-yaml',
\]
" ultisnips - snippet engine
Pack 'SirVer/ultisnips'
Pack 'honza/vim-snippets'
" vimomni - Completion for vimscript
Pack 'vim-scripts/vimomni', {'type': 'opt'}
" ale - Asynchronous Lint Engine
Pack 'w0rp/ale'
let g:ale_sign_error = '▸'
let g:ale_sign_warning = '▸'
let g:ale_echo_msg_format = '[%linter%] %s (%code%)'
let g:ale_linters = {'c': [], 'cpp': []}
let g:ale_cmake_cmakelint_options =
\ '-convention/filename,-package/consistency,-package/stdargs'
" Version control differences in the sign column
Pack 'mhinz/vim-signify'
" format.vim - format with text objects
Pack 'git@bitbucket.org:infektor/format.vim.git'
" vim-textobj-user - library for creating text objects
Pack 'kana/vim-textobj-user'
" vim-textobj-entire - Entire file text object
let g:textobj_entire_no_default_key_mappings = 1
Pack 'kana/vim-textobj-entire'
xmap a% <Plug>(textobj-entire-a)
omap a% <Plug>(textobj-entire-a)
xmap i% <Plug>(textobj-entire-i)
omap i% <Plug>(textobj-entire-i)
" vim-textobj-parameter - Parameter text object
Pack 'sgur/vim-textobj-parameter'
" vim-textobj-uri - URI text object
Pack 'jceb/vim-textobj-uri'
" vim-textobj-comment - Comment text object
Pack 'glts/vim-textobj-comment'
omap a/ <Plug>(textobj-comment-a)
xmap a/ <Plug>(textobj-comment-a)
omap i/ <Plug>(textobj-comment-i)
xmap i/ <Plug>(textobj-comment-i)
" vim-textobj-sentence - Improved sentence text object
Pack 'reedes/vim-textobj-sentence'
" vim-commentary - toggle comments
Pack 'tpope/vim-commentary'
" vim-surround - edit delimiters
Pack 'tpope/vim-surround'
" vim-repeat - better dot command
Pack 'tpope/vim-repeat'
" vim-fugitive - git wrapper
Pack 'tpope/vim-fugitive'
" vim-eunuch - unix command warppers
Pack 'tpope/vim-eunuch'
" vim-vinegar - improved directory browser
Pack 'tpope/vim-vinegar'
" vim-abolish - CamelCase to under_score to mixedCase
" TODO: Copy the good bit remove this plugin
Pack 'tpope/vim-abolish'
" vim-unimpaired - for pairs of tasks
Pack 'tpope/vim-unimpaired'
" vim-speeddating - sane date manipulation
Pack 'tpope/vim-speeddating'
" vim-endwise - wisely add end{if,function}, fork with cmake support
Pack 'godbyk/vim-endwise', {'rev': 'patch-1'}
" vim-jdaddy - text object & formatting for json
Pack 'tpope/vim-jdaddy'
" vim-projectionist - granular project configuration
Pack 'tpope/vim-projectionist'
" fzf.vim - Fuzzy finder
Pack 'junegunn/fzf'
Pack 'junegunn/fzf.vim'
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-s': 'split',
\ 'ctrl-v': 'vsplit'
\ }
Pack 'kbenzie/note.vim'
let g:note_directory = '~/Sync/Notes'
if !has('win32')
" Seemless vim/tmux pane navigation
Pack 'christoomey/vim-tmux-navigator'
let g:tmux_navigator_no_mappings = 1
" Enable focus events when in tmux session
Pack 'tmux-plugins/vim-tmux-focus-events'
endif
" replay macros with the enter key
Pack 'wincent/replay'
" vim-matchit - Improved % matching
Pack 'andymass/vim-matchup'
let g:matchup_matchparen_offscreen = {'method': 'status_manual'}
" vim-table-mode - Easy table manipulation
Pack 'dhruvasagar/vim-table-mode'
let g:table_mode_map_prefix = '<leader>t'
let g:table_mode_toggle_map = 'M'
" DoxygenToolkit.vim - documentation stubs
Pack 'vim-scripts/DoxygenToolkit.vim', {'type': 'opt'}
let g:DoxygenToolkit_commentType = 'C++'
" markdown fenced code block languages
let g:markdown_fenced_languages =
\ ['cpp', 'c', 'cmake', 'console', 'sh', 'vim', 'python', 'yaml']
" reStructedText enable code styles
let g:rst_style = 1
" reStructuredText code block languages
let g:rst_syntax_code_list = {
\ 'vim': ['vim'],
\ 'java': ['java'],
\ 'c': ['c'],
\ 'cpp': ['cpp', 'c++'],
\ 'console': ['console'],
\ 'python': ['python']
\ }
" Python folding
Pack 'kalekundert/vim-coiled-snake'
" Enable builtin syntax folding
let g:xml_syntax_folding = 1
let g:sh_fold_enabled = 1
" xterm-color-table.vim - view term and hex colors
Pack 'guns/xterm-color-table.vim'
" Syntax plugins
Pack 'kbenzie/vim-spirv'
let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c'
Pack 'rperier/vim-cmake-syntax'
Pack 'tikhomirov/vim-glsl'
Pack 'beyondmarc/hlsl.vim'
Pack 'frasercrmck/opencl.vim'
Pack 'asciidoc/vim-asciidoc'
Pack 'mustache/vim-mustache-handlebars'
Pack 'joshglendenning/vim-caddyfile'
Pack 'kbenzie/vim-khr'
Pack 'jrozner/vim-antlr'
" Plugins for remote integrations
Pack 'greymd/oscyank.vim', {'type': 'opt'}
if tmux#isOption('set-clipboard', 'on')
packadd oscyank.vim
endif