da8c9c5cc77fda70c22ae53713411bb170f78b75
dblume Remove explicit settings th...

dblume authored 10 months ago

1) " Version 2024-03-07.1 - First misc fixes
dblume Add Neovim configs

dblume authored 10 months ago

2) set bs=2            " allow backspacing over everything in insert mode
3) set smartindent     " Do smart auto indenting when starting  new line
4) set foldlevel=99
5) set nowrap          " no wrapping text lines on the screen (exceptions below)
6) set sidescroll=5
dblume Use build-in style for nvim...

dblume authored 10 months ago

7) set listchars+=tab:>-,precedes:<,extends:>,nbsp:·,eol:\\u21b5 " for :set list
dblume Add Neovim configs

dblume authored 10 months ago

8) set scrolloff=0     " EC2 defaults to 5. Set explicitly to be consistent
9) set notermguicolors " Only needed for neovim while I port my color schemes
dblume Remove explicit settings th...

dblume authored 10 months ago

10) set undofile        " undo even after closing and reopening a file
dblume Small responsiveness improv...

dblume authored 10 months ago

11) set noshowcmd       " Show size of selected area in visual mode on last line
dblume Decided I usually wanted ru...

dblume authored 2 months ago

12) set ruler           " Show coordinates on status line
dblume nvim set hidden

dblume authored 10 months ago

13) set hidden          " Don't abandon Scratch buffer when hidden.
dblume Don't set cursorline if we'...

dblume authored 10 months ago

14) "set cursorline     " For CursorLineNR formatting similar to pre 8.0.
dblume Set cursorlineopt to number...

dblume authored 10 months ago

15) set culopt=number   " Otherwise diff views have an underline. neovim issue 9800
dblume Simplify vim titlestring: p...

dblume authored 9 months ago

16) " Set the title of the terminal window. Consider changing titlestring, %t, %M
17) set title titlestring=%f%m\ -\ nvim
dblume Don't use unnamed register...

dblume authored 9 months ago

18) 
19) " WSL clipboard-tool fom 'help clipboard'
20) "let g:clipboard = {
21) "            \   'name': 'WslClipboard',
22) "            \   'copy': {
23) "            \      '+': '/mnt/c/Windows/system32/clip.exe',
24) "            \      '*': '/mnt/c/Windows/system32/clip.exe',
25) "            \    },
26) "            \   'paste': {
27) "            \      '+': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
28) "            \      '*': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
29) "            \   },
30) "            \   'cache_enabled': 0,
31) "            \ }
32) 
33) " Yank and put into the system Clipboard (register + or *)
34) " Otherwise make explicit commands "+yy "+y "+Y (or * instead of + as needed)
35) " N.B. Don't use unnamed register for clipboard (set clipboard=unnamed)
36) "      Delete operations would overwrite clipboard before pasting.
dblume Disable maps in cscope_maps

dblume authored 4 months ago

37) " Also N.B. cscope_maps might assign <leader>c to its prefix.
dblume Don't use unnamed register...

dblume authored 9 months ago

38) nnoremap <leader>c "+
39) vnoremap <leader>c "+
dblume Add Neovim configs

dblume authored 10 months ago

40) 
41) " Make j and k move to the next row, not file line
42) nnoremap j gj
43) nnoremap k gk
44) 
45) " From Steve Losh: http://learnvimscriptthehardway.stevelosh.com/chapters/10.html
46) " Map jk to ESC in insert mode (except when navigating popup menu)
47) inoremap <expr> jk pumvisible() ? '' : '<esc>'
48) inoremap <expr> j pumvisible() ? '<Down>' : 'j'
49) inoremap <expr> k pumvisible() ? '<Up>' : 'k'
dblume Map Tab and CR to pull-up-m...

dblume authored 9 months ago

50) inoremap <expr> <Tab> pumvisible() ? '<Down>' : '<Tab>'
51) inoremap <expr> <S-Tab> pumvisible() ? '<Up>' : '<S-Tab>'
52) inoremap <expr> <cr> pumvisible() ? '<C-y>' : '<cr>'
dblume Add Neovim configs

dblume authored 10 months ago

53) 
54) " https://stevelosh.com/blog/2010/09/coming-home-to-vim/#s3-why-i-came-back-to-vim
55) nnoremap <leader>v <C-w>v<C-w>l
56) nnoremap <C-h> <C-w>h
57) nnoremap <C-j> <C-w>j
58) nnoremap <C-k> <C-w>k
59) nnoremap <C-l> <C-w>l
60) 
61) " clear search highlights
62) nnoremap <cr> :noh<cr><cr>
63) 
dblume Have terminal emulator send...

dblume authored 9 months ago

64) " tmux 3.2+ doesn't send C-i, so have Alacritty iTerm2 map C-i to <leader>i
65) " iTerm2: Settings > Keys > Key Bindings > + > Shortcut:^i Action:Send Text "\i"
dblume Alacritty+tmux: Map <C-i> t...

dblume authored 9 months ago

66) nnoremap <leader>i <C-i>
dblume Have terminal emulator send...

dblume authored 9 months ago

67) " Use (Shift-)Tab to navigate buffers, retain C-i/C-o for jumps.
dblume When Tab distinguished from...

dblume authored 9 months ago

68) " Test with this:
69) " nvim -Nu NONE +'nno <C-i> :echom "C-i pressed"<cr>' +'nno <tab> :echom "Tab pressed"<cr>'
dblume Have terminal emulator send...

dblume authored 9 months ago

70) "if stridx(expand($TERM), 'xterm') == 0
dblume When Tab distinguished from...

dblume authored 9 months ago

71)   nnoremap <C-i> <C-i>
dblume Alacritty+tmux: Map <C-i> t...

dblume authored 9 months ago

72)   nmap <Tab> :bn<cr>
dblume Have terminal emulator send...

dblume authored 9 months ago

73) "endif
dblume Restore Ctrl-i (Tab) to mea...

dblume authored 9 months ago

74) nnoremap <S-Tab> :bp<cr>
dblume Add Neovim configs

dblume authored 10 months ago

75) 
76) set t_Co=256
dblume First tweaks for neovim, tw...

dblume authored 10 months ago

77) set colorcolumn=80
dblume Add Neovim configs

dblume authored 10 months ago

78) if has('gui_running') " Didn't work: if &term != 'builtin_gui'
79)   " Light backgrounds for GUI experiences
80)   set background=light
81)   " colorscheme peaksea
82)   colorscheme tolerable
dblume First tweaks for neovim, tw...

dblume authored 10 months ago

83)   highlight ColorColumn ctermbg=255 guibg=#F6F6F6
dblume nvim ColorColumn was inverted

dblume authored 10 months ago

84)   highlight statusline   ctermfg=17 ctermbg=Gray  " override scheme
85)   highlight statuslineNC ctermfg=20 ctermbg=LightGray  " override scheme
dblume Add Neovim configs

dblume authored 10 months ago

86)   if has('win32')
87)     set guifont=DejaVu_Sans_Mono_for_Powerline:h10:cANSI:qDRAFT
88)   endif
89)   set lines=50 columns=100
90) else
91)   " Dark backgrounds for tty experiences
92)   set background=dark
93)   colorscheme nvim_desert
94) endif
95) 
dblume Vim insert mode's blue shou...

dblume authored 10 months ago

96) au InsertEnter * hi statusline guibg=Cyan ctermfg=25 guifg=Black ctermbg=248
dblume Make the normal statusbar m...

dblume authored 10 months ago

97) au InsertLeave * hi statusline term=bold,reverse cterm=bold,reverse ctermfg=23 ctermbg=250 guifg=black guibg=#c2bfa5
dblume Add Neovim configs

dblume authored 10 months ago

98) 
dblume Restore cursor line number...

dblume authored 10 months ago

99) " See https://neovim.io/doc/user/vim_diff.html#_default-mouse
dblume Restore nvim mouse mode to nvi

dblume authored 3 weeks ago

100) " set mouse=  " neovim defaults to nvi
dblume Add Neovim configs

dblume authored 10 months ago

101) 
dblume vim: Don't move cursor when...

dblume authored 5 days ago

102) " Don't move the cursor when activating window (incompatible on PuTTY)
103) augroup NO_CURSOR_MOVE_ON_FOCUS
104)   au!
105)   au FocusLost * let g:oldmouse=&mouse | set mouse=
106)   au FocusGained * if exists('g:oldmouse') | let &mouse=g:oldmouse | unlet g:oldmouse | endif
107) augroup END
108) 
dblume Set prev jump point on mous...

dblume authored 3 weeks ago

109) " Set jump point from before mouse click.
110) nnoremap <LeftMouse> m'<LeftMouse>
dblume vim mouse events in insert...

dblume authored 1 week ago

111) inoremap <LeftMouse> <Esc>m'<LeftMouse>
dblume Set prev jump point on mous...

dblume authored 3 weeks ago

112) 
dblume Make c-] show taglist like...

dblume authored 10 months ago

113) " Make c-] show a list of tags, or jump straight if only single tag
dblume Disable maps in cscope_maps

dblume authored 4 months ago

114) " Note cscope_maps plugin might map c-].
dblume Make c-] show taglist like...

dblume authored 10 months ago

115) nnoremap <c-]> g<c-]>
116) vnoremap <c-]> g<c-]>
117) nnoremap g<c-]> <c-]>
118) vnoremap g<c-]> <c-]>
dblume First tweaks for neovim, tw...

dblume authored 10 months ago

119) " Consider neovim default "./tags;,tags"
dblume Add Neovim configs

dblume authored 10 months ago

120) set tags=tags;/
121) 
dblume First tweaks for neovim, tw...

dblume authored 10 months ago

122) set history=500
dblume Add Neovim configs

dblume authored 10 months ago

123) 
dblume Retrieve git branch only on...

dblume authored 10 months ago

124) function! GitBranch()
dblume Make vim StatuslineGit() re...

dblume authored 10 months ago

125)   let l:branchname = system("git -C " . expand('%:p:h') . " rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
dblume Add the powerline git char...

dblume authored 9 months ago

126)   return strlen(l:branchname) > 0 ? '  │  '.l:branchname : ''
dblume Add Neovim configs

dblume authored 10 months ago

127) endfunction
128) 
dblume Only show encoding and form...

dblume authored 10 months ago

129) function! EncodingAndFormat()
130)   if (len(&fileencoding) && &fileencoding != 'utf-8') || &fileformat != 'unix'
131)     return &fileencoding?&fileencoding:&encoding .'['. &fileformat . '] │ '
132)   endif
133)   return ''
134) endfunction
135) 
dblume Make "set ruler!" change st...

dblume authored 10 months ago

136) function! OnRuler()
137)   if &ruler
138)     return '│ '.line('.').':'.col('.').' '
139)   endif
140)   return ''
141) endfunction
142) 
dblume Add Neovim configs

dblume authored 10 months ago

143) function! Current_mode()
144)   let l:currentmode={
145)     \ 'n'  : 'NORMAL',
146)     \ 'v'  : 'VISUAL',
147)     \ 'V'  : 'V·LINE',
148)     \ '' : 'V·BLOCK',
149)     \ 's'  : 'SELECT',
150)     \ 'S'  : 'S·LINE',
151)     \ 'i'  : 'INSERT',
152)     \ 'r'  : 'I·REPLACE',
153)     \ 'R'  : 'REPLACE',
154)     \ 'Rv' : 'V·REPLACE',
155)     \ 'c'  : 'COMMAND',
156)     \}
157)     return get(l:currentmode, mode(), mode())
158) endfunction
159) 
160) function! Trim_brackets(fn)
161)   if v:version > 800
162)     return trim(a:fn, "[]")
163)   else
164)     return a:fn
165)   endif
166) endfunction
167) 
168) set statusline=\ %{Current_mode()}
169) set statusline+=%{&paste?'\ \ ·\ PASTE':''}
dblume Retrieve git branch only on...

dblume authored 10 months ago

170) set statusline+=%{b:git_branch}
dblume Add Neovim configs

dblume authored 10 months ago

171) set statusline+=\ │\ %f
172) set statusline+=%m
173) set statusline+=\ %r
174) set statusline+=\ %=
175) set statusline+=%h
176) set statusline+=\ %{Trim_brackets(&filetype)}
177) set statusline+=\ %#StatusLineNC#
dblume Only show encoding and form...

dblume authored 10 months ago

178) set statusline+=\ %{b:enc_fmt}
179) set statusline+=%p%%\ of
dblume Drop column and line number...

dblume authored 10 months ago

180) set statusline+=\ %L\ 
dblume Make "set ruler!" change st...

dblume authored 10 months ago

181) set statusline+=%{OnRuler()}
dblume Add Neovim configs

dblume authored 10 months ago

182) 
183) " Fast saving
184) nmap <leader>w :w!<cr>
185) " I use relative number for cursor movement.
186) nmap <leader>r :set relativenumber!<cr>
187) nmap <leader>n :set number!<cr>
188) 
189) " Useful mappings for managing tabs
190) " Tab Previous: gT or C-PageUp
191) " Tab Next: gt or C-PageDown
192) nmap <leader>tn :tabnew
193) nmap <leader>to :tabonly<cr>
194) nmap <leader>tc :tabclose<cr>
195) nmap <leader>tm :tabmove
196) nmap <leader>1 1gt
197) nmap <leader>2 2gt
198) nmap <leader>3 3gt
199) nmap <leader>4 4gt
200) nmap <leader>5 5gt
201) nmap <leader>6 6gt
202) nmap <leader>7 7gt
203) nmap <leader>8 8gt
204) nmap <leader>9 9gt
205) 
206) " Open current buffer in new tab. Close with C-w,c
207) " https://vim.fandom.com/wiki/Maximize_window_and_return_to_previous_split_structure
208) function! OpenCurrentAsNewTab()
209)     let l:currentView = winsaveview()
210)     tabedit %
211)     call winrestview(l:currentView)
212) endfunction
213) nmap <leader>o :call OpenCurrentAsNewTab()<CR>
214) 
215) " pastetoggle
216) nmap <leader>p :set invpaste paste?<cr>
217) 
218) " Control+p to paste onto next line
219) nmap <C-p> :pu<cr>
220) 
221) " Make netrw's Explore behave a little like NERDTreeToggle
222) " http://vimcasts.org/blog/2013/01/oil-and-vinegar-split-windows-and-project-drawer/
223) function! ToggleNetrw()
224)   if bufwinnr("NetrwTreeListing") > 0
225)     for i in range(1, bufnr("$"))
226)       if (getbufvar(i, "&filetype") == "netrw")
227)         silent exe "bwipeout " . i
228)         return
229)       endif
230)     endfor
231)   endif
232)   silent Vexplore %:p:h
233) endfunction
234) nmap <leader>e :call ToggleNetrw()<cr>
235) 
236) " install taglist
237) let Tlist_GainFocus_On_ToggleOpen = 1  " Jump to taglist window on open
238) let Tlist_Exit_OnlyWindow = 1          " if you are the last, kill yourself
239) let Tlist_Close_On_Select = 1          " Close taglist window on select
dblume Disable taglist's auto resi...

dblume authored 10 months ago

240) let Tlist_Inc_Winwidth = 0             " Only needed for neovim in tmux
dblume Add Neovim configs

dblume authored 10 months ago

241) nmap <leader>l :TlistToggle<cr>
242) 
243) " install vim-bbye
244) nmap <leader>bd :Bdelete<cr>
245) 
246) " Visual mode mappings
247) """
248) 
249) " map sort function to a key
250) vnoremap <leader>s :sort<cr>
251) 
252) "easier moving of code blocks
253) vnoremap < <gv
254) vnoremap > >gv
255) 
256) " If too many file system events are getting triggered.
257) set nobackup       " ~ files
258) set nowritebackup  " Don't write buff to temp, delete orig, rename temp to orig
259) set noswapfile     " .swp files
260) 
261) " Switch between source and header files
262) function! SwitchSourceHeader()
263)   let s:ext  = expand("%:e")
264)   let s:base = expand("%:t:r")
265)   let s:cmd  = "find " . s:base
266)   if (s:ext == "cpp" || s:ext == "c")
267)     if findfile(s:base . ".h"  ) != "" | exe s:cmd . ".h"   | return | en
268)     if findfile(s:base . ".hpp") != "" | exe s:cmd . ".hpp" | return | en
269)   else
270)     if findfile(s:base . ".cpp") != "" | exe s:cmd . ".cpp" | return | en
271)     if findfile(s:base . ".c"  ) != "" | exe s:cmd . ".c"   | return | en
272)   endif
273) endfunc
274) 
275) " Demonstrates a way to look in a mirror directory
276) " function! OpenOther()
277) "    if expand("%:e") == "cpp"
278) "      exe "split" fnameescape(expand("%:p:r:s?src?include?").".h")
279) "    elseif expand("%:e") == "h"
280) "      exe "split" fnameescape(expand("%:p:r:s?include?src?").".cpp")
281) "    endif
282) " endfunc
283) 
284) " Delete trailing white space on save, useful for Python and CoffeeScript ;)
285) function! DeleteTrailingWS()
286)   exe "normal mz"
287)   %s/\s\+$//ge
288)   exe "normal `z"
289) endfunc
290) 
291) function! OpenInOtherWindow()
292)   if winnr('$') == 1
293)     exe "wincmd F"
294)   else
295)     let curNum = winnr()
296)     let oldBuf = bufnr( "%" )
297)     if curNum == 1
298)       let othNum = 2
299)     else
300)       let othNum = 1
301)     endif
302)     exe "normal! gF"
303)     let newBuf = bufnr( "%" )
304)     let newLine = line(".")
305)     exe 'hide buf' oldBuf
306)     exe othNum . "wincmd w"
307)     exe 'hide buf' newBuf
308)     exe "normal! " . newLine . "G"
309)   endif
310) endfunc
311) 
312) nmap <silent> <leader>F :call OpenInOtherWindow()<cr>
313) nmap <silent> <leader>f :call OpenInOtherWindow()<cr>
314) 
315) if has("autocmd")
316)   autocmd BufWrite *.py :call DeleteTrailingWS()  " Delete trailing whitespace
317)   " Don't let smartindent unindent the # character in Python files
318)   autocmd FileType python  inoremap # X<c-h>#
319)   autocmd FileType python,c,cpp,php,brs,sh  set expandtab  " Use spaces instead of tabs
dblume Make "-" a non-breaking cha...

dblume authored 3 months ago

320)   autocmd FileType make    setl noexpandtab                " ...not for files that use tabs.
321)   autocmd FileType markdown  set iskeyword+=-  " Add - to list of non-word-breaking chars.
dblume Add Neovim configs

dblume authored 10 months ago

322) 
323)   " Use the vim command %retab before applying the following
324)   " two with files that have 8-space tabs.
325)   autocmd FileType c,cpp,python,php  set tabstop=4
326)   autocmd FileType c,cpp,php  set shiftwidth=4
327) 
328)   autocmd FileType python  set foldmethod=indent  " 'za' to fold
329) 
330)   autocmd FileType c,cpp nmap <buffer> <leader>s :call SwitchSourceHeader()<cr>
331)   autocmd FileType c,cpp set foldmethod=syntax
332) 
dblume Improve focus-based switchi...

dblume authored 10 months ago

333) " https://jeffkreeftmeijer.com/vim-number/
dblume Decided I usually wanted ru...

dblume authored 2 months ago

334) " Disabling for now, just keep the mode that was explicitly requested.
335) "augroup numbertoggle
336) "  autocmd!
337) "  autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu   | endif
338) "  autocmd BufLeave,FocusLost,InsertEnter,WinLeave   * if &nu                  | set nornu | endif
339) "augroup END
dblume Add Neovim configs

dblume authored 10 months ago

340) 
341)   autocmd BufRead *.txt set wrap linebreak   " "soft" wrap of existing lines
342)   autocmd BufRead README set wrap linebreak  " "soft" wrap of existing lines
343)   autocmd BufRead *.rs :setlocal tags=./rusty-tags.vi;/
344) 
dblume Always start on first line...

dblume authored 10 months ago

345)   " When editing a file, always jump to the last cursor position...
dblume Add Neovim configs

dblume authored 10 months ago

346)   autocmd BufReadPost *
dblume Always start on first line...

dblume authored 10 months ago

347)   \ if line("'\"") > 0 && line ("'\"") <= line("$") |
dblume When openging files jump to...

dblume authored 9 months ago

348)   \   exe "normal! g`\"" |
dblume Add Neovim configs

dblume authored 10 months ago

349)   \ endif
dblume Always start on first line...

dblume authored 10 months ago

350)   " ...except for gitcommit where we always want to start at the top
351)   autocmd FileType gitcommit exe "normal! gg"
dblume Retrieve git branch only on...

dblume authored 10 months ago

352) 
dblume Only show encoding and form...

dblume authored 10 months ago

353)   autocmd BufNewFile,BufReadPost *
354)   \ let b:git_branch = GitBranch() |
355)   \ let b:enc_fmt = EncodingAndFormat()
356)   autocmd BufEnter *
357)   \ let b:git_branch = GitBranch() |
358)   \ let b:enc_fmt = EncodingAndFormat()
dblume Don't set cursorline if we'...

dblume authored 10 months ago

359) 
360)   " I only use a cursorline style for the number column
361)   autocmd OptionSet number,relativenumber if v:option_new | set cursorline | endif
dblume Add Neovim configs

dblume authored 10 months ago

362) endif
363) 
364) " This requires vim to be compiled with +python
365) " Use auto complete in insert mode with ctrl-x, ctrl-o
366) " See :help new-omni-completion for more.
367) filetype plugin on
368) set omnifunc=syntaxcomplete#Complete
369) 
370) " Torn on whether I like the omni completion preview window left open or not.
371) " autocmd CompleteDone * pclose
372) 
373) " Omni completion via ctrl-space (in addition to ctrl-x ctrl-o)
dblume Sensibly, in neovim <C-Spac...

dblume authored 10 months ago

374) inoremap <C-Space> <C-x><C-o>
dblume Add Neovim configs

dblume authored 10 months ago

375) 
dblume Add commands SynStack and H...

dblume authored 9 months ago

376) " These two commands display syntax/highlight info for what's under the cursor.
377) if exists(":SynStack") != 2
378)     command SynStack :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
379) endif
380) 
381) function! SynGroup()
382)     let l:s = synID(line('.'), col('.'), 1)
383)     echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
384) endfun
385) command Hi :call SynGroup()
dblume Add Neovim configs

dblume authored 10 months ago

386) 
387) " From https://stackoverflow.com/questions/15393301/how-to-automatically-sort-quickfix-entries-by-line-text-in-vim
388) " :grep term %
389) " :grep -r term path/
390) " :cw
391) " :ccl (or C-w,q)
392) autocmd! QuickfixCmdPost * call MaybeSortQuickfix('QfStrCmp')
393) 
394) function! MaybeSortQuickfix(fn)
395) "    exe 'normal! '  " Doesn't work. Wanted to jump back to where we were.
396)     let t = getqflist({'title': 1}).title
397)     " Only sort the files if for search-style commands, not "make".
398)     if stridx(t, "cs ") == 0 || stridx(t, ":gr") == 0 || stridx(t, ":vim") == 0 || stridx(t, ":rg") == 0
399)         call setqflist(sort(getqflist(), a:fn), 'r')
400)         call setqflist([], 'r', {'title': t})
401)     endif
402)     cwindow
403) endfunction
404) 
405) function! QfStrCmp(e1, e2)
406)     let [t1, t2] = [bufname(a:e1.bufnr), bufname(a:e2.bufnr)]
407)     return t1 <# t2 ? -1 : t1 ==# t2 ? 0 : 1
408) endfunction
409) 
410) " Use ripgrep for search instead of grep
411) if executable('rg')
412)     " set grepprg=rg\ --vimgrep\ --hidden\ —glob '!.git'
413)     set grepprg=rg
414) endif
415) " Navigate quickfix list with ease
416) nnoremap <silent> [q :cprevious<CR>
417) nnoremap <silent> ]q :cnext<CR>
418) 
dblume Add DiffOrig from the vim h...

dblume authored 10 months ago

419) " From `:help :DiffOrig`.
dblume Make "set ruler!" change st...

dblume authored 10 months ago

420) if exists(":DiffOrig") != 2
421)   command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_
dblume Add DiffOrig from the vim h...

dblume authored 10 months ago

422)     \ | diffthis | wincmd p | diffthis
dblume Make "set ruler!" change st...

dblume authored 10 months ago

423) endif
dblume Add DiffOrig from the vim h...

dblume authored 10 months ago

424) 
dblume Add Neovim configs

dblume authored 10 months ago

425) " I use Roboto Mono from https://github.com/powerline/fonts
426) " On iTerm2, Preferences -> Profiles -> Text -> Font
427) " Cygwin64 won't let you choose it. Launch Cygwin64 as follows:
428) " C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -o Font="Roboto Mono for Powerline" -
429) 
430) " Settings that make netrw more like NERDTree
431) let g:netrw_banner = 0
432) let g:netrw_liststyle = 3
433) let g:netrw_browse_split = 4
434) let g:netrw_altv = 1
435) " set g:netrw_winsize to negative for absolute width, positive for relative
436) let g:netrw_winsize = -36
437) " let g:netrw_winsize = 35
438) " sort is affecting only: directories on the top, files below
439) let g:netrw_sort_sequence = '[\/]$,*'
440) 
441) " Experimenting with vim-rooter
442) let g:rooter_patterns = ['.git', 'Makefile', 'builds/']
443) let g:rooter_cd_cmd = 'lcd'
444) let g:rooter_manual_only = 1
445) 
dblume Add "rainbow" plugin for co...

dblume authored 8 months ago

446) " 'Rainbow Parentheses Improved' https://github.com/luochen1990/rainbow/
dblume Exclude filetype rokulog fr...

dblume authored 7 months ago

447) let g:rainbow_conf = {
448) \   'ctermfgs': ['223', 'lightblue', '180', 'green', 'yellow', '111'],
449) \   'separately': { 'rokulog': 0 }
450) \ }
dblume Add "rainbow" plugin for co...

dblume authored 8 months ago

451) let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
452) 
dblume Add commands SynStack and H...

dblume authored 9 months ago

453) " See https://wiki.dlma.com/neovim#cscope
454) lua << EOF
dblume Disable maps in cscope_maps

dblume authored 4 months ago

455)   require('cscope_maps').setup({ 
456)     disable_maps = true, -- Mapping C-] to :Cstag <cword> worse than :tag <cword>
dblume Detect rokulog files even w...

dblume authored 2 months ago

457)   -- Alternatively, if we liked the mappings, then customise these two:
458)   --    skip_input_prompt = true,
459)   --    cscope = { skip_picker_for_single_result = true },
dblume Disable maps in cscope_maps

dblume authored 4 months ago

460)   })
dblume Detect rokulog files even w...

dblume authored 2 months ago

461) 
462)   -- From https://www.reddit.com/r/neovim/comments/wcq6sp/override_file_type_detection_for_existing/
463)   vim.filetype.add {
dblume Add support for neovim 0.10

dblume authored 1 month ago

464)     pattern = {
465)       ['.*'] = {
466)         priority = -math.huge,
467)         function(path, bufnr)
468)           local rokulog_pat = [[^\d\{2\}-\d\{2\} \d\{2\}:\d\{2\}:\d\{2\}.\d\{3\}\s\+\(!\|n\|dev\|\d\+\(_[0-9a-f]\+\)\?\|tvinput\.\S\+\)\?[ *]\[]]
469)           if vim.fn.has('nvim-0.10') == 1 then
470)             local content = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ''
471)             if vim.regex(rokulog_pat):match_str(content) ~= nil then
472)               return 'rokulog'
473)             end
474)           else
475)             local content = vim.filetype.getlines(bufnr, 1)
476)             if vim.filetype.matchregex(content, rokulog_pat) then
477)               return 'rokulog'
478)             end
479)           end
480)         end,
481)       },
dblume Detect rokulog files even w...

dblume authored 2 months ago

482)     },
dblume Add support for neovim 0.10

dblume authored 1 month ago

483)   }