2c91698265ed50212c996285ccfea57a481720ac
dblume Remove explicit settings th...

dblume authored 1 year ago

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

dblume authored 1 year 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 11 months ago

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

dblume authored 1 year 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 1 year ago

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

dblume authored 1 year ago

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

dblume authored 3 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 10 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 10 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) 
dblume Try nvim clipboard+=unnamed...

dblume authored 3 days ago

33) " N.B. Don't just use unnamed register for clipboard (set clipboard=unnamed)
34) "      Delete operations would overwrite clipboard before pasting.
35) set clipboard+=unnamedplus
36) 
37) " Will remove these two remappings if unnamedplus (above) does the job
dblume Don't use unnamed register...

dblume authored 10 months ago

38) " Yank and put into the system Clipboard (register + or *)
39) " Otherwise make explicit commands "+yy "+y "+Y (or * instead of + as needed)
dblume Try nvim clipboard+=unnamed...

dblume authored 3 days ago

40) " N.B. cscope_maps might assign <leader>c to its prefix.
41) "nnoremap <leader>c "+
42) "vnoremap <leader>c "+
dblume Add Neovim configs

dblume authored 1 year ago

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

dblume authored 11 months ago

53) inoremap <expr> <Tab> pumvisible() ? '<Down>' : '<Tab>'
54) inoremap <expr> <S-Tab> pumvisible() ? '<Up>' : '<S-Tab>'
55) inoremap <expr> <cr> pumvisible() ? '<C-y>' : '<cr>'
dblume Add Neovim configs

dblume authored 1 year ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 10 months ago

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

dblume authored 1 year ago

78) 
79) set t_Co=256
dblume First tweaks for neovim, tw...

dblume authored 1 year ago

80) set colorcolumn=80
dblume Add Neovim configs

dblume authored 1 year ago

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

dblume authored 1 year ago

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

dblume authored 1 year ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

101) 
dblume Restore cursor line number...

dblume authored 11 months ago

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

dblume authored 2 months ago

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

dblume authored 1 year ago

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

dblume authored 1 month ago

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

dblume authored 1 month ago

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

dblume authored 11 months ago

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

dblume authored 5 months ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 1 year ago

122) set tags=tags;/
123) 
dblume First tweaks for neovim, tw...

dblume authored 1 year ago

124) set history=500
dblume Add Neovim configs

dblume authored 1 year ago

125) 
dblume Retrieve git branch only on...

dblume authored 11 months ago

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

dblume authored 11 months ago

127)   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 10 months ago

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

dblume authored 1 year ago

129) endfunction
130) 
dblume Only show encoding and form...

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 4 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 3 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 10 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

354) 
dblume Only show encoding and form...

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 1 year ago

377) 
dblume Add commands SynStack and H...

dblume authored 10 months ago

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

dblume authored 1 year ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

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

dblume authored 11 months ago

426) 
dblume Add Neovim configs

dblume authored 1 year ago

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

dblume authored 9 months ago

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

dblume authored 9 months ago

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

dblume authored 9 months ago

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

dblume authored 10 months ago

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

dblume authored 5 months ago

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

dblume authored 3 months ago

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

dblume authored 5 months ago

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

dblume authored 3 months ago

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

dblume authored 3 months ago

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

dblume authored 3 months ago

484)     },
dblume Add support for neovim 0.10

dblume authored 3 months ago

485)   }