1
0
mirror of https://github.com/sameer1612/.dotfiles.git synced 2024-11-19 18:01:53 +02:00

Optimized .vimrc for usage on remote machines with kitty

This commit is contained in:
Sameer Kumar 2023-10-24 13:00:05 +00:00 committed by GitHub
parent 4ab94db40e
commit 65a5093b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

58
.vimrc
View File

@ -1,19 +1,64 @@
" Mouse support
set mouse=a
set ttymouse=sgr
set balloonevalterm
" Styled and colored underline support
let &t_AU = "\e[58:5:%dm"
let &t_8u = "\e[58:2:%lu:%lu:%lum"
let &t_Us = "\e[4:2m"
let &t_Cs = "\e[4:3m"
let &t_ds = "\e[4:4m"
let &t_Ds = "\e[4:5m"
let &t_Ce = "\e[4:0m"
" Strikethrough
let &t_Ts = "\e[9m"
let &t_Te = "\e[29m"
" Truecolor support
let &t_8f = "\e[38:2:%lu:%lu:%lum"
let &t_8b = "\e[48:2:%lu:%lu:%lum"
let &t_RF = "\e]10;?\e\\"
let &t_RB = "\e]11;?\e\\"
" Bracketed paste
let &t_BE = "\e[?2004h"
let &t_BD = "\e[?2004l"
let &t_PS = "\e[200~"
let &t_PE = "\e[201~"
" Cursor control
let &t_RC = "\e[?12$p"
let &t_SH = "\e[%d q"
let &t_RS = "\eP$q q\e\\"
let &t_SI = "\e[5 q"
let &t_SR = "\e[3 q"
let &t_EI = "\e[1 q"
let &t_VS = "\e[?12l"
" Focus tracking
let &t_fe = "\e[?1004h"
let &t_fd = "\e[?1004l"
execute "set <FocusGained>=\<Esc>[I"
execute "set <FocusLost>=\<Esc>[O"
" Window title
let &t_ST = "\e[22;2t"
let &t_RT = "\e[23;2t"
" vim hardcodes background color erase even if the terminfo file does
" not contain bce. This causes incorrect background rendering when
" using a color theme with a background color in terminals such as
" kitty that do not support background color erase.
let &t_ut=''
" Options
set autoindent
set backspace=indent,eol,start
set clipboard+=unnamedplus
set cursorline
set expandtab
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
set ignorecase
set mouse=a
set number
set relativenumber
set scrolloff=4
set shiftwidth=2
set showmode
set signcolumn=yes
set smartcase
set smartindent
set spelllang=en
@ -51,8 +96,3 @@ nnoremap <leader>sx :close<CR> " Close current split
nnoremap <leader>w :w<CR> " Write buffer
nnoremap J 5j " Move 5 lines down
nnoremap K 5k " Move 5 lines up
nnoremap j v:count == 0 ? 'gj' : 'j' " Move vertically
nnoremap k v:count == 0 ? 'gk' : 'k' " Move vertically
vnoremap <M-k> :m '<-2<CR>gv=gv " Move line down in visual mode
vnoremap <M-k> :m '>+1<CR>gv=gv " Move line up in visual mode