dotfiles/auto/vim/.vimrc
DuckDuckWhale 2df4e7a091
Misc: SSH, Vim, Helix, Ubuntu, setup, shells, ...
- SSH config: disable password and send COLORTERM
- Vim: use <space>u instead of <space>w
- Helix:
	- Update for bug fixes after 23.10
	- Install bash completions, desktop file, and icon
	- Fix bufferline and inlay hints color
	- Reenable auto pairs since smart tabs is a thing now
- Ubuntu:
	- Update to 23.10
	- Change naming convention
	- Add podman and qemu-user-static
- Setup:
	- Update install and swap config
	- Add fish, Pods, Steam
	- Fix CJK font config path
	- Remove Firefox Wayland override now that it's the default
- Shells: configure fish
- Manual:
	- Configure starship
	- Use cargo locked install
	- Remove sparse protocol config now that it's the default
	- Fix failure when fish config directory is not found
- tmux: fix truecolor support for Alacritty
2024-01-19 16:21:22 -08:00

80 lines
2.0 KiB
VimL

filetype plugin indent on
syntax on
autocmd CmdwinEnter * noremap <buffer> <CR> <CR>
autocmd FileType rust,c,cpp,java,python,sh,tex set noexpandtab colorcolumn=101 textwidth=100
autocmd FileType markdown set noexpandtab colorcolumn=81 textwidth=80
autocmd FileType markdown,tex set ai spell
set encoding=utf-8
set termencoding=utf-8
set fileencodings=ucs-bom,utf-8,chinese
let mapleader=" "
nnoremap <space> <nop>
nnoremap Y y$
nnoremap <CR> :
vnoremap <CR> :
nnoremap <silent> <leader>f 1z=
nnoremap <silent> <leader>h :noh<CR>:echo "Stopped search highlighting."<CR>
nnoremap <silent> <leader>i :call ToggleIntuitiveLineMovement()<CR>
nnoremap <silent> <leader>l :set list!<CR>
nnoremap <silent> <leader>q gwap
nnoremap <silent> <leader>r :set relativenumber!<CR>
nnoremap <silent> <leader>s :call ToggleSpellCheck()<CR>
nnoremap <silent> <leader>u :update<CR>
set backspace=indent,eol,start " powerful backspace
set complete+=kspell " dictionary completion
set cpo+=J " sentences are separated by two spaces
set display=lastline " show as much as possible when it doesn't fit
set hlsearch
set incsearch
set listchars=eol:$,tab:>-,trail
set mouse=a
set number
set relativenumber
set showcmd
set spelllang=en_us,cjk
hi Normal ctermfg=white ctermbg=none
hi Search ctermfg=yellow ctermbg=black
hi IncSearch ctermfg=black ctermbg=yellow
hi LineNr ctermfg=10 ctermbg=0
hi CursorLineNr ctermfg=12 ctermbg=0
hi Visual ctermfg=16 ctermbg=yellow
hi Pmenu ctermfg=NONE ctermbg=236
hi PmenuSel ctermfg=0 ctermbg=10
set tabstop=4
set shiftwidth=4
set timeout ttimeoutlen=25
function! ToggleSpellCheck()
set spell!
if &spell
echo "Spell check is now on."
else
echo "Spell check is now off."
endif
endfunction
function! ToggleIntuitiveLineMovement()
if mapcheck("jk")==""
echo "Intuitive line movement is now on."
nnoremap j gj
nnoremap k gk
inoremap <down> <C-o>gj
inoremap <up> <C-o>gk
else
echo "Intuitive line movement is now off."
nunmap j
nunmap k
iunmap <down>
iunmap <up>
endif
endfunction