All the latest changes.

This commit is contained in:
ikolokolnikov committed 2026-09-15 16:19:34 -07:00
1 parent 9632256e1b
commit cef83f1278
20 files changed
+438 -136

No files matched your search

+50 -12
View File
@@ -6,9 +6,9 @@ colorscheme habamax
set nobackup nowritebackup
set noswapfile
set number
"set number
set tabstop=8
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
@@ -31,7 +31,6 @@ set timeoutlen=1000
set ttimeoutlen=0
set hidden
set wildmenu
set clipboard=unnamed,unnamedplus
set colorcolumn=75
"set backspace=indent,eol,start
@@ -78,31 +77,64 @@ function! CreateOrSelectWindow()
endfunction
function! PutIntoShade()
let max_width = float2nr(&columns * 0.95)
let min_width = float2nr(&columns * 0.5)
let shade = float2nr(&columns * 0.95)
let default = float2nr(&columns * 0.5)
let min = float2nr(&columns * 0.5)
if winwidth(0) > min_width
execute 'vertical resize ' . min_width
elseif winwidth(0) <= min_width
execute 'vertical resize ' . max_width
if winwidth(0) <= min
execute 'vertical resize ' . shade
else
execute 'vertical resize ' . default
endif
endfunction
" Preserve paste line column
function! PasteAbove()
let l = getline('.')
let c = col('.')
normal! P
call cursor(0, c)
if getline('.') == l
call cursor(0, c)
endif
endfunction
function! PasteBelow()
let l = getline('.')
let c = col('.')
normal! p
call cursor(0, c)
if getline('.') == l
call cursor(0, c)
endif
endfunction
function! IsPreviewOpen() abort
for l:win in range(1, winnr('$'))
if getwinvar(l:win, '&previewwindow') == 1
return 1
endif
endfor
return 0
endfunction
function! TagsTogglePreview(symbol)
if IsPreviewOpen()
execute 'pclose'
else
execute 'ptag ' . a:symbol
endif
endfunction
" ----- Custom Keymaps ----------------------------------------------------
nnoremap <silent> K <Nop>
"nnoremap <silent> K <Nop>
xnoremap p P
nnoremap <silent> ` ngnP
vnoremap <silent> > >:normal gv<CR>
vnoremap <silent> < <:normal gv<CR>
@@ -119,6 +151,8 @@ nnoremap <silent> < :cp<CR>
nnoremap <silent> g/ :noh<CR>
nnoremap <silent> gs :w<CR>
nnoremap <silent> E :Ex<CR>
nnoremap <silent> <space>z :set relativenumber!<CR>
@@ -137,6 +171,8 @@ nnoremap <silent> # :call PutIntoShade()<CR>
nnoremap <silent> P :call PasteAbove()<CR>
nnoremap <silent> p :call PasteBelow()<CR>
nnoremap <silent> <space>cp :call TagsTogglePreview(expand('<cword>'))<CR>
" ----- Highlights --------------------------------------------------------
" Todo Comments highlights
" Colors: https://vim.fandom.com/wiki/Xterm256_color_names_for_console_Vim
@@ -157,3 +193,5 @@ augroup HiglightTODO
autocmd WinEnter,VimEnter * :silent! call matchadd('TODOFix', 'FIX:', -1)
autocmd WinEnter,VimEnter * :silent! call matchadd('TODOWarning', 'WARNING:', -1)
augroup END
set clipboard=unnamed