cd130c482ce4f34ec5f1a7cf8da97271fc8f25de
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 9 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 9 months ago

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

dblume authored 9 months ago

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

dblume authored 8 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 8 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 8 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 8 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 8 months ago

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

dblume authored 8 months ago

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

dblume authored 8 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 8 months ago

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

dblume authored 8 months ago

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

dblume authored 8 months ago

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

dblume authored 8 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 9 months ago

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

dblume authored 2 weeks ago

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

dblume authored 10 months ago

101) 
dblume Set prev jump point on mous...

dblume authored 1 week ago

102) " Set jump point from before mouse click.
103) nnoremap <LeftMouse> m'<LeftMouse>
104) 
dblume Make c-] show taglist like...

dblume authored 9 months ago

105) " 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

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

dblume authored 9 months ago

107) nnoremap <c-]> g<c-]>
108) vnoremap <c-]> g<c-]>
109) nnoremap g<c-]> <c-]>
110) vnoremap g<c-]> <c-]>
dblume First tweaks for neovim, tw...

dblume authored 10 months ago

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

dblume authored 10 months ago

112) set tags=tags;/
113) 
dblume First tweaks for neovim, tw...

dblume authored 10 months ago

114) set history=500
dblume Add Neovim configs

dblume authored 10 months ago

115) 
dblume Retrieve git branch only on...

dblume authored 10 months ago

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

dblume authored 10 months ago

117)   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

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

dblume authored 10 months ago

119) endfunction
120) 
dblume Only show encoding and form...

dblume authored 10 months ago

121) function! EncodingAndFormat()
122)   if (len(&fileencoding) && &fileencoding != 'utf-8') || &fileformat != 'unix'
123)     return &fileencoding?&fileencoding:&encoding .'['. &fileformat . '] │ '
124)   endif
125)   return ''
126) endfunction
127) 
dblume Make "set ruler!" change st...

dblume authored 10 months ago

128) function! OnRuler()
129)   if &ruler
130)     return '│ '.line('.').':'.col('.').' '
131)   endif
132)   return ''
133) endfunction
134) 
dblume Add Neovim configs

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

163) set statusline+=\ │\ %f
164) set statusline+=%m
165) set statusline+=\ %r
166) set statusline+=\ %=
167) set statusline+=%h
168) set statusline+=\ %{Trim_brackets(&filetype)}
169) set statusline+=\ %#StatusLineNC#
dblume Only show encoding and form...

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 9 months ago

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

dblume authored 10 months ago

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

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

dblume authored 10 months ago

314) 
315)   " Use the vim command %retab before applying the following
316)   " two with files that have 8-space tabs.
317)   autocmd FileType c,cpp,python,php  set tabstop=4
318)   autocmd FileType c,cpp,php  set shiftwidth=4
319) 
320)   autocmd FileType python  set foldmethod=indent  " 'za' to fold
321) 
322)   autocmd FileType c,cpp nmap <buffer> <leader>s :call SwitchSourceHeader()<cr>
323)   autocmd FileType c,cpp set foldmethod=syntax
324) 
dblume Improve focus-based switchi...

dblume authored 10 months ago

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

dblume authored 2 months ago

326) " Disabling for now, just keep the mode that was explicitly requested.
327) "augroup numbertoggle
328) "  autocmd!
329) "  autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu   | endif
330) "  autocmd BufLeave,FocusLost,InsertEnter,WinLeave   * if &nu                  | set nornu | endif
331) "augroup END
dblume Add Neovim configs

dblume authored 10 months ago

332) 
333)   autocmd BufRead *.txt set wrap linebreak   " "soft" wrap of existing lines
334)   autocmd BufRead README set wrap linebreak  " "soft" wrap of existing lines
335)   autocmd BufRead *.rs :setlocal tags=./rusty-tags.vi;/
336) 
dblume Always start on first line...

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 8 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

344) 
dblume Only show encoding and form...

dblume authored 10 months ago

345)   autocmd BufNewFile,BufReadPost *
346)   \ let b:git_branch = GitBranch() |
347)   \ let b:enc_fmt = EncodingAndFormat()
348)   autocmd BufEnter *
349)   \ let b:git_branch = GitBranch() |
350)   \ let b:enc_fmt = EncodingAndFormat()
dblume Don't set cursorline if we'...

dblume authored 9 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

367) 
dblume Add commands SynStack and H...

dblume authored 9 months ago

368) " These two commands display syntax/highlight info for what's under the cursor.
369) if exists(":SynStack") != 2
370)     command SynStack :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
371) endif
372) 
373) function! SynGroup()
374)     let l:s = synID(line('.'), col('.'), 1)
375)     echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
376) endfun
377) command Hi :call SynGroup()
dblume Add Neovim configs

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

416) 
dblume Add Neovim configs

dblume authored 10 months ago

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

dblume authored 7 months ago

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

dblume authored 7 months ago

439) let g:rainbow_conf = {
440) \   'ctermfgs': ['223', 'lightblue', '180', 'green', 'yellow', '111'],
441) \   'separately': { 'rokulog': 0 }
442) \ }
dblume Add "rainbow" plugin for co...

dblume authored 7 months ago

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

dblume authored 9 months ago

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

dblume authored 4 months ago

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

dblume authored 1 month ago

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

dblume authored 4 months ago

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

dblume authored 1 month ago

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

dblume authored 1 month ago

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

dblume authored 1 month ago

474)     },
dblume Add support for neovim 0.10

dblume authored 1 month ago

475)   }