aboutsummaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-18 19:07:51 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-18 19:07:51 +0100
commit726dde6a048a477725e877d65abae91161397fad (patch)
tree1f6e8d2c79545a708a6b91f05ad2750a4be5eefe /vim
parent755669574124db68660ca70363a8585f4fbba8a3 (diff)
Adds binding for fzf-nova
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc107
1 files changed, 50 insertions, 57 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 708191d..5b98fcb 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,11 +1,11 @@
-" Setup {{{
+" Setup
set nocompatible
filetype indent on
filetype plugin on
" syntax on
runtime macros/matchit.vim "allows jumping between brackets with % in normal mode
-" }}}
-" Leaders {{{
+"
+" Leaders
let maplocalleader = "\\"
let mapleader = ","
nnoremap <leader>tsk 0i- [ ]
@@ -92,10 +92,11 @@ command! -nargs=1 SearchAndAddToQuickfix call SearchAndAddToQuickfix(<q-args>)
" Define a keybinding to call SearchAndAddToQuickfix
nnoremap <leader>f :call SearchAndAddToQuickfix(input('Search term: '))<CR>
-" }}}
-" Options {{{
+"
+" Options
set clipboard=unnamed,unnamedplus " just past in with out needing "*
set autoread
+set ttyfast
set exrc
set nocuc
set secure
@@ -140,27 +141,18 @@ set shortmess+=c
set tags+=./tags
set background=dark
set completeopt=menuone,longest
-" }}}
-" Function to allow adding a line of text to taskwarrior {{{
-function! TaskWarriorAddCurrentLine()
- let current_line = getline('.')
- silent execute ":!task add " . shellescape(current_line)
- redraw!
- echo "Task added: " . current_line
- delete
-endfunction
-" }}}
-" Folding {{{
+"
+" Folding
if has('folding')
set foldmethod=marker " default
" set foldmethod=syntax
-" set foldmarker=#\ {{{,#\ }}}
+" set foldmarker=#\ ,#\
set viewoptions=folds,options,cursor,unix,slash
endif
" disable folding by default with vim-markdown
let g:vim_markdown_folding_disabled = 1
-" }}}
-" Remaps {{{
+"
+" Remaps
let @x = 'o- [ ] '
noremap <silent> J 10j
noremap <silent> K 10k
@@ -171,8 +163,8 @@ let @s = ")i\<BS>\<CR>\<Esc>"
command! W w
" Open Fern with Ctrl-N
nnoremap <C-n> :Fern -drawer .<CR> <C-w>l
-" }}}
-" Plugins {{{
+"
+" Plugins
call plug#begin()
"Plug 'vim-scripts/AutoComplPop'
Plug 'mattn/emmet-vim',
@@ -202,20 +194,21 @@ Plug 'SirVer/UltiSnips'
Plug 'honza/vim-snippets'
Plug 'dense-analysis/ale'
call plug#end()
-" }}}
-" Snippets {{{
+"
+" Snippets
" Trigger configuration. You need to change this to something other than
"<tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
-let g:UltiSnipsExpandTrigger="<S-t>"
+let g:UltiSnipsExpandTrigger="<C-y>"
+"let g:UltiSnipsExpandTrigger="<S-t>"
let g:UltiSnipsJumpForwardTrigger="<S-f>"
let g:UltiSnipsJumpBackwardTrigger="<S-b>"
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]
"
-" }}}
-" {{{ emmet
+"
+" emmet
" being very explicit, which is not required
autocmd FileType css imap html <tab> <plug>(emmet-expand-abbr)
let g:user_emmet_leader_key = '<C-b>'
@@ -234,8 +227,8 @@ let g:user_emmet_anchorizeurl_key = '<C-b>a'
let g:user_emmet_anchorizesummary_key = '<C-b>A'
let g:user_emmet_mergelines_key = '<C-b>m'
let g:user_emmet_codepretty_key = '<C-b>c'
-"}}}
-" vim-tailwind {{{
+"
+" vim-tailwind
function! s:is_tailwind()
return !empty(findfile('tailwind.config.js', '.;')) ||
\ !empty(findfile('theme/static_src/tailwind.config.js', '.;'))
@@ -246,8 +239,8 @@ nmap <silent> <buffer> gk <Plug>(tailwind-lookup)
autocmd BufEnter *.html,*.slim if s:is_tailwind() |
\ setlocal omnifunc=tailwind#Complete |
\ endif
-" }}}
-" ALE {{{
+"
+" ALE
let g:ale_enabled = 1
let g:ale_set_balloons = 0
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
@@ -297,8 +290,8 @@ let g:ale_completion_enabled = 0
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
set omnifunc=ale#completion#OmniFunc
-" }}}
-" :grep use ripgrep {{{
+"
+" :grep use ripgrep
if executable('rg')
set grepprg=rg\ --color=never\ --vimgrep
endif
@@ -312,16 +305,16 @@ command! -bang -nargs=* Rg
\ <bang>0)
nnoremap <C-p>a :Rg
-" }}}
-" 'Notes Grep' with ripgrep (see grepprg) {{{
+"
+" 'Notes Grep' with ripgrep (see grepprg)
" -i case insensitive
" -g glob pattern
" ! to not immediately open first search result
"command! -nargs=1 Ngrep :silent grep! "<args>" -i -g '*.md' $NOTES_DIR | execute ':redraw!'
command! -nargs=1 Ngrep vimgrep "<args>" $NOTES_DIR/**/*.md
nnoremap <leader>nn :Ngrep
-" }}}
-" vim-test {{{
+"
+" vim-test
nmap <silent> tn :TestNearest<CR>
nmap <silent> tf :TestFile<CR>
nmap <silent> ts :TestSuite<CR>
@@ -331,8 +324,8 @@ let test#strategy = "basic"
let test#python#pytest#options = '-q -s'
let test#python#runner = 'pytest'
let test#vimterminal#term_position = "belowright"
-" }}}
-" Titbits {{{
+"
+" Titbits
" " Increment an ordered (numbered) list with <leader><cr>
" inoremap <leader><cr> <esc>yyp<C-a>
" " sudo write
@@ -341,8 +334,8 @@ let test#vimterminal#term_position = "belowright"
"nnoremap <Tab> %
nnoremap <C-@> :call system("wl-copy", @")<CR>
xnoremap <silent> <C-@> :w !wl-copy<CR><CR>
-" }}}
-" FZF {{{
+"
+" FZF
" This is the default extra key bindings
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
@@ -373,8 +366,8 @@ let g:fzf_colors =
nnoremap <C-s> :GFiles!<CR>
imap <C-x><C-f> <plug>(fzf-complete-file-ag)
imap <C-x><C-l> <plug>(fzf-complete-line)
-" }}}
-" Colorscheme {{{
+"
+" Colorscheme
" This is imported from the old ephemera.vim file which has now been removed
"
" I got the following from gruvbox docs
@@ -411,8 +404,8 @@ let g:gruvbox_italic = 0
colorscheme ayu
"colorscheme evening
"colorscheme gruvbox
-" }}}
-" GPG files {{{
+"
+" GPG files
" from https://vim.fandom.com/wiki/Edit_gpg_encrypted_files
" Don't save backups of *.gpg files
set backupskip+=*.gpg
@@ -442,8 +435,8 @@ augroup encrypted
\ silent u |
\ setlocal nobin
augroup END
-" }}}
-" Golang {{{
+"
+" Golang
augroup golang
autocmd!
autocmd FileType go
@@ -451,8 +444,8 @@ augroup golang
\ set softtabstop=8 |
\ set shiftwidth=8
augroup END
-" }}}
-" GitFZF {{{
+"
+" GitFZF
" from https://git.sr.ht/~sircmpwn/dotfiles/tree/master/item/.vimrc
function! GitFZF()
let path = trim(system('cd '.shellescape(expand('%:p:h')).' && git rev-parse --show-toplevel'))
@@ -460,26 +453,26 @@ function! GitFZF()
endfunction
command! GitFZF call GitFZF()
nnoremap <leader><C-f> :GitFZF<CR>
-" }}}
-" Switching off colours {{{
+"
+" Switching off colours
"syntax off
" hi Visual term=reverse ctermbg=7 ctermfg=black guifg=black guibg=LightPink
" hi SpellBad term=reverse ctermbg=224 gui=undercurl guisp=Red guibg=Red
" hi SpellCap term=reverse ctermbg=224 gui=undercurl guisp=Red guibg=Red
" hi SpellRare term=reverse ctermbg=224 gui=undercurl guisp=Red guibg=Blue
" hi Search term=reverse ctermbg=11 guifg=black guibg=Green
-"}}}
-" Turn spelling on for text files {{{
+"
+" Turn spelling on for text files
" from - https://dmerej.info/blog/post/syntax-highlighting-is-useless/
" augroup textfiles
" autocmd!
" autocmd filetype markdown setlocal spell spelllang=en
" augroup end
-" }}}
-" Read man pages in vim {{{
+"
+" Read man pages in vim
runtime! ftplugin/man.vim
-" }}}
-"" YouCompleteMe {{{
+"
+"" YouCompleteMe
"" -"" *** STARTING AND ENABLING ***
"" Don't start on start - or use show_diagnostics below
"let g:loaded_youcompleteme = 1
@@ -508,4 +501,4 @@ runtime! ftplugin/man.vim
"imap <silent> <C-l> <Plug>(YCMToggleSignatureHelp)'.
"let g:ycm_enable_inlay_hints = 0
-"" }}}
+""