Compare commits

...

20 Commits

Author SHA1 Message Date
00e30facd3 Disable Node, Perl, and Ruby providers
I never used these so disable attempting to load them.
2024-03-02 10:48:07 +00:00
e378b83549 Update nvim-qt GuiFont setting 2023-12-09 11:09:32 +00:00
1de326471c Switch to vim-argumentative, remove vim-textobj-parameter 2023-11-23 23:22:15 +00:00
aab402fa73 Disable vim-spirv settings that are slow in large files 2023-09-13 16:50:59 +01:00
586141cb14 Fix todo (and other) snippets
coc-snippets stopped accepting the multiline python code in the todo
(and other) snippets, this fixes an `UnexpectedIndentation` exception.
2023-07-27 17:53:20 +01:00
f8407f959f Fix cpp commentstring, its a lua setting now... 2023-07-16 18:43:13 +01:00
97c7c974cf Add plugin Vim-Jinja2-Syntax 2023-06-28 14:08:14 +01:00
35acaa6cb2 Don't prompt for ultisnips in coc.nvim 2023-06-16 10:18:41 +01:00
3334451c2a Add workaround for coc-yaml's Ansible failings 2023-04-25 20:55:31 +01:00
d29cfc6aab Remove support for _template snippets 2023-03-30 15:28:42 +01:00
024268db74 Remove argparse from Python main snippet 2023-03-30 15:01:53 +01:00
0c515161b0 Add coc.nvim mapping for references used 2023-02-15 16:58:03 +00:00
525f6c2a5f Add editorconfig plugin 2023-02-15 16:57:39 +00:00
0d4dab892e Don't ignore case in command line file completions 2023-01-26 17:52:11 +00:00
24de16b587 Drop UltiSnips and move to coc-snippets
Also change the completion confirm mapping to <TAB> and make the
priority of snippets higher.
2023-01-25 00:40:41 +00:00
226765f88a Disable coc.nvim inlay hints globally 2023-01-19 12:17:20 +00:00
20c3c27bd7 Drop ale plugin and config 2023-01-13 22:46:29 +00:00
877d90dd90 Fix windows switching mappings when not in tmux 2023-01-09 23:20:15 +00:00
8f578862ef Add vim-bundle-mako plugin for mako template language 2022-11-25 14:13:07 +00:00
9cc65d5e1f Remove comments from individual syntax plugins 2022-11-25 14:12:55 +00:00
14 changed files with 104 additions and 85 deletions

View File

@@ -27,18 +27,15 @@ class Comment(object):
endglobal endglobal
snippet todo "TODO commment" snippet todo "TODO commment"
`!p comment=Comment() `!p comment=Comment();snip.rv=comment.before()`TODO${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=comment.after()`
snip.rv=comment.before()`TODO${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=comment.after()`
endsnippet endsnippet
snippet fixme "FIXME comment" snippet fixme "FIXME comment"
`!p comment=Comment() `!p comment=Comment();snip.rv=comment.before()`FIXME${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=comment.after()`
snip.rv=comment.before()`FIXME${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=comment.after()`
endsnippet endsnippet
snippet note "NOTE comment" snippet note "NOTE comment"
`!p comment=Comment() `!p comment=Comment();snip.rv=comment.before()`NOTE: $0`!p snip.rv=comment.after()`
snip.rv=comment.before()`NOTE: $0`!p snip.rv=comment.after()`
endsnippet endsnippet
global !p global !p

View File

@@ -1,13 +1,3 @@
snippet _template "help file template"
*`!p snip.rv = snip.fn`* For Vim version 8.0 Last change: `!p
from datetime import datetime
snip.rv = datetime.now().strftime('%B %d, %Y')`
$0
vim:tw=78:ts=8:ft=help:norl:
endsnippet
snippet s "help section" snippet s "help section"
============================================================================== ==============================================================================
${1:1}. ${2:Section}`!p ${1:1}. ${2:Section}`!p

View File

@@ -3,13 +3,8 @@ snippet #! "Shebang"
endsnippet endsnippet
snippet main "Python main stub" snippet main "Python main stub"
from argparse import ArgumentParser
def main(): def main():
parser = ArgumentParser() ${0:pass}
$0
args = parser.parse_args()
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -1,6 +1,5 @@
function! s:set_lit_cfg_filetype() function! s:set_lit_cfg_filetype()
set filetype=python set filetype=python
ALEDisableBuffer
endfunction endfunction
au BufNewFile,BufReadPost lit.cfg call s:set_lit_cfg_filetype() au BufNewFile,BufReadPost lit.cfg call s:set_lit_cfg_filetype()

1
after/ftplugin/cpp.lua Normal file
View File

@@ -0,0 +1 @@
vim.bo.commentstring = '//%s'

View File

@@ -1,16 +0,0 @@
" Description: Expand snippet on file creation.
" Attempt to expand the _template snippet if this is a new file.
" https://noahfrederick.com/log/vim-templates-with-ultisnips-and-projectionist
function! snippet#template() abort
" Return if non-empty buffer or file exists.
if !(line('$') == 1 && getline('$') ==# '') || filereadable(expand('%'))
return
endif
" Attempt to expand the _template snippet.
execute "normal! i_template\<C-r>=UltiSnips#ExpandSnippet()\<CR>"
if g:ulti_expand_res == 0
" Expansions failed, undo insert.
silent! undo
endif
endfunction

View File

@@ -1,17 +1,81 @@
{ {
"clangd.inlayHints.enable": false,
"cmake.lsp.enable": true, "cmake.lsp.enable": true,
"diagnostic.enableHighlightLineNumber": false, "diagnostic.enableHighlightLineNumber": false,
"diagnostic.errorSign": "▸", "diagnostic.errorSign": "▸",
"diagnostic.hintSign": "▸", "diagnostic.hintSign": "▸",
"diagnostic.infoSign": "▸", "diagnostic.infoSign": "▸",
"diagnostic.warningSign": "▸", "diagnostic.warningSign": "▸",
"inlayHint.enable": false,
"powershell.integratedConsole.showOnStartup": false, "powershell.integratedConsole.showOnStartup": false,
"snippets.priority": 100,
"suggest.noselect": true, "suggest.noselect": true,
"yaml.schemas": { "yaml.schemas": {
"https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json": [ "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json": [
".gitlab-ci.yml", ".gitlab-ci.yml",
".gitlab/ci.yml",
".gitlab/ci/*.yml" ".gitlab/ci/*.yml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json": [
".ansible-lint",
".config/ansible-lint.yml",
".config/ansible-lint.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-navigator.json": [
"ansible-navigator.yml",
"ansible-navigator.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/execution-environment.json": [
"execution-environment.yml",
"execution-environment.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/galaxy.json": [
"galaxy.yml",
"galaxy.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json": [
"inventory.yaml",
"inventory.yml",
"inventory/*.yml",
"inventory/*.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/meta-runtime.json": [
"meta/runtime.yml",
"meta/runtime.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/molecule.json": [
"molecule/*/molecule.yml",
"molecule/*/molecule.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json": [
"playbooks/*.yml",
"playbooks/*.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/requirements.json": [
"requirements.yml",
"requirements.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/rulebook.json": [
"rulebooks/*.yml",
"rulebooks/*.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/tasks.json": [
"tasks/*.yml",
"tasks/*.yaml",
"handlers/*.yml",
"handlers/*.yaml"
],
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/vars.json": [
"playbooks/vars/*.yml",
"playbooks/vars/*.yaml",
"vars/*.yml",
"vars/*.yaml",
"defaults/*.yml",
"defaults/*.yaml",
"host_vars/*.yml",
"host_vars/*.yaml",
"group_vars/*.yml",
"group_vars/*.yaml"
] ]
} },
"snippets.ultisnips.pythonPrompt": false
} }

View File

@@ -202,11 +202,6 @@ if has('gui_running') || &t_Co == 256
call s:hi('Important', '220', '', 'bold') call s:hi('Important', '220', '', 'bold')
call s:hi('Research', '202', '', 'bold') call s:hi('Research', '202', '', 'bold')
call s:hi('ALEError', '160', '', '')
call s:hi('ALEWarning', '129', '', '')
call s:hi('ALEErrorSign', '160', '233', 'bold')
call s:hi('ALEWarningSign', '129', '233', 'bold')
call s:hi('CocErrorSign', '160', '233', '') call s:hi('CocErrorSign', '160', '233', '')
call s:hi('CocErrorFloat', '160', '235', '') call s:hi('CocErrorFloat', '160', '235', '')
call s:hi('CocWarningSign', '129', '233', '') call s:hi('CocWarningSign', '129', '233', '')

View File

@@ -1,9 +1,5 @@
if exists(':GuiFont') if exists(':GuiFont')
if platform#is_windows() GuiFont! CaskaydiaCove\ Nerd\ Font\ Mono:h9
GuiFont! Source\ Code\ Pro:h10
else
GuiFont Source\ Code\ Pro:h9
endif
endif endif
if exists(':GuiTabline') if exists(':GuiTabline')

View File

@@ -18,10 +18,6 @@ augroup benieAugroup
" Read template into buffer then send line 1 to the black hold register " Read template into buffer then send line 1 to the black hold register
au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _ au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _
" Attempt to expand snippet named `_template` if it exists
au BufNewFile * silent! call snippet#template()
" Do the same when filetype changes to help
au FileType help silent! call snippet#template()
" Augment vim-signify by modifying it's autocmds " Augment vim-signify by modifying it's autocmds
au User SignifyAutocmds call do#signify() au User SignifyAutocmds call do#signify()

View File

@@ -1,12 +1,14 @@
" coc.nvim " coc.nvim
nmap <silent> <leader>fi <Plug>(coc-fix-current) inoremap <silent><expr> <TAB> coc#pum#visible() ? coc#pum#confirm() : "\<TAB>"
nmap <silent> <leader>gd <Plug>(coc-definition) nnoremap <silent> <leader>fi <Plug>(coc-fix-current)
nmap <silent> <leader>gt <Plug>(coc-type-definition) nnoremap <silent> <leader>gd <Plug>(coc-definition)
nmap <silent> <leader>sd <Plug>(coc-diagnostic-info) nnoremap <silent> <leader>gt <Plug>(coc-type-definition)
nmap <silent> <leader>gr <Plug>(coc-references) nnoremap <silent> <leader>sd <Plug>(coc-diagnostic-info)
nmap <silent> K :call do#show_documentation()<CR> nnoremap <silent> <leader>gr <Plug>(coc-references)
nmap <silent> <C-n> <Plug>(coc-diagnostic-next) nnoremap <silent> <leader>gu <Plug>(coc-references-used)
nmap <silent> <C-p> <Plug>(coc-diagnostic-prev) nnoremap <silent> K :call do#show_documentation()<CR>
nnoremap <silent> <C-n> <Plug>(coc-diagnostic-next)
nnoremap <silent> <C-p> <Plug>(coc-diagnostic-prev)
if has('nvim') if has('nvim')
" Make nvim :terminal more like vim :terminal " Make nvim :terminal more like vim :terminal
@@ -64,7 +66,12 @@ nnoremap k gk
nnoremap <leader>w :w!<CR> nnoremap <leader>w :w!<CR>
" Switch panes in a tmux aware way " Switch panes in a tmux aware way
if !has('win32') if !tmux#inSession() || has('win32')
nnoremap <silent> <C-h> <C-w>h
nnoremap <silent> <C-j> <C-w>j
nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> <C-l> <C-w>l
else
nnoremap <silent> <C-h> :TmuxNavigateLeft<CR> nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <C-j> :TmuxNavigateDown<CR> nnoremap <silent> <C-j> :TmuxNavigateDown<CR>
nnoremap <silent> <C-k> :TmuxNavigateUp<CR> nnoremap <silent> <C-k> :TmuxNavigateUp<CR>
@@ -84,11 +91,6 @@ if !has('win32')
tnoremap <silent> <C-w>k <C-w>N:TmuxNavigateUp<CR> tnoremap <silent> <C-w>k <C-w>N:TmuxNavigateUp<CR>
tnoremap <silent> <C-w>l <C-w>N:TmuxNavigateRight<CR> tnoremap <silent> <C-w>l <C-w>N:TmuxNavigateRight<CR>
endif endif
else
nnoremap <silent> <C-h> <C-w>h
nnoremap <silent> <C-j> <C-w>j
nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> <C-l> <C-w>l
endif endif
" Quick tabs " Quick tabs

View File

@@ -112,6 +112,8 @@ set isfname-=:
set hlsearch incsearch set hlsearch incsearch
" Set ignore search case unless mixed " Set ignore search case unless mixed
set ignorecase smartcase set ignorecase smartcase
" Don't ignore case in command line file completions
set nofileignorecase
" Allow buffers with changes to be hidden " Allow buffers with changes to be hidden
set hidden set hidden

View File

@@ -7,14 +7,11 @@
# Conqueror of Completion # Conqueror of Completion
- repo: neoclide/coc.nvim - repo: neoclide/coc.nvim
branch: release branch: release
# Snippet engine & snippets # Snippet collection
- repo: SirVer/ultisnips
- repo: honza/vim-snippets - repo: honza/vim-snippets
# Completion for vimscript # Completion for vimscript
- repo: vim-scripts/vimomni - repo: vim-scripts/vimomni
mode: opt mode: opt
# Asynchronous Lint Engine
- repo: w0rp/ale
# Version control differences in the sign column # Version control differences in the sign column
- repo: mhinz/vim-signify - repo: mhinz/vim-signify
# Conflict marker utilities # Conflict marker utilities
@@ -48,14 +45,14 @@
- repo: kana/vim-textobj-user - repo: kana/vim-textobj-user
# TODO: Doesn't work with nvim # TODO: Doesn't work with nvim
- repo: kana/vim-textobj-entire - repo: kana/vim-textobj-entire
# Text object for function parameters
- repo: sgur/vim-textobj-parameter
# Text object for URI's # Text object for URI's
- repo: jceb/vim-textobj-uri - repo: jceb/vim-textobj-uri
# Text object for comment blocks # Text object for comment blocks
- repo: glts/vim-textobj-comment - repo: glts/vim-textobj-comment
# Text object for sentences # Text object for sentences
- repo: reedes/vim-textobj-sentence - repo: reedes/vim-textobj-sentence
# Text object & bindings for arguments
- repo: PeterRincker/vim-argumentative
# ================================ Tim Pope ============================== # ================================ Tim Pope ==============================
@@ -97,7 +94,7 @@
# =============================== Syntax ================================= # =============================== Syntax =================================
# Python folding - repo: editorconfig/editorconfig-vim
- repo: kalekundert/vim-coiled-snake - repo: kalekundert/vim-coiled-snake
- repo: kbenzie/vim-spirv - repo: kbenzie/vim-spirv
- repo: rperier/vim-cmake-syntax - repo: rperier/vim-cmake-syntax
@@ -109,6 +106,8 @@
- repo: joshglendenning/vim-caddyfile - repo: joshglendenning/vim-caddyfile
- repo: kbenzie/vim-khr - repo: kbenzie/vim-khr
- repo: jrozner/vim-antlr - repo: jrozner/vim-antlr
- repo: sophacles/vim-bundle-mako
- repo: Glench/Vim-Jinja2-Syntax
- name: remove minpac directory - name: remove minpac directory
when: ansible_os_family != "Windows" when: ansible_os_family != "Windows"

17
vimrc
View File

@@ -15,6 +15,11 @@ endif
set runtimepath+=~/.config/work set runtimepath+=~/.config/work
set packpath+=~/.config/work set packpath+=~/.config/work
" Disable unused providers
let g:loaded_node_provider = 0
let g:loaded_perl_provider = 0
let g:loaded_ruby_provider = 0
" Markdown fenced code block languages " Markdown fenced code block languages
let g:markdown_fenced_languages = let g:markdown_fenced_languages =
\ ['cpp', 'c', 'cmake', 'console', 'sh', 'vim', 'python', 'yaml'] \ ['cpp', 'c', 'cmake', 'console', 'sh', 'vim', 'python', 'yaml']
@@ -59,7 +64,7 @@ let g:coc_global_extensions = [
\ 'coc-json', \ 'coc-json',
\ 'coc-marketplace', \ 'coc-marketplace',
\ 'coc-pyright', \ 'coc-pyright',
\ 'coc-ultisnips', \ 'coc-snippets',
\ 'coc-vimlsp', \ 'coc-vimlsp',
\ 'coc-yaml', \ 'coc-yaml',
\] \]
@@ -70,14 +75,6 @@ if has("win32")
endif endif
let g:coc_default_semantic_highlight_groups = 0 let g:coc_default_semantic_highlight_groups = 0
" 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'
" vim-signify " vim-signify
let g:signify_sign_change = '~' let g:signify_sign_change = '~'
@@ -114,4 +111,6 @@ let g:table_mode_toggle_map = 'M'
let g:DoxygenToolkit_commentType = 'C++' let g:DoxygenToolkit_commentType = 'C++'
" vim-spirv " vim-spirv
let g:spirv_enable_current_id = 0
let g:spirv_enable_extinst_error = 0
let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c' let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c'