Skip to content

Instantly share code, notes, and snippets.

@Kyllingene
Last active October 4, 2023 00:04
Show Gist options
  • Save Kyllingene/7a64b294be5f83d2f1a65008e4f02cf1 to your computer and use it in GitHub Desktop.
Save Kyllingene/7a64b294be5f83d2f1a65008e4f02cf1 to your computer and use it in GitHub Desktop.
My no-plugins vim configuration. Uses external theme.
" basic settings
set relativenumber
set number
syntax on
set backspace=indent,eol,start
set so=10
" theme
set background=dark
"" using morhetz/gruvbox
autocmd vimenter * ++nested colorscheme gruvbox
" indentation
set expandtab
set shiftwidth=4
set tabstop=4
set autoindent
set smartindent
" change swap file locations to save git
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
"" keymaps
" make \\ comment out a line
au FileType vim nmap <buffer> \\ I" <Esc>
au FileType sh,zsh,csh,tcsh,make,py nmap <buffer> \\ I# <Esc>
au FileType html,xhtml,xml,xslt,dtd,xsd nmap <buffer> \\ I<!-- <Esc>A --><Esc>
au FileType sql,haskell nmap <buffer> \\ I-- <Esc>
au FileType c nmap <buffer> \\ I/* <Esc>A */<Esc>
au FileType cpp,rs,zig nmap <buffer> \\ I// <Esc>
au FileType * nmap <buffer> \\ 0i# <Esc>
"" document display
set conceallevel=2
"" basic settings
set relativenumber
set number
syntax on
set backspace=indent,eol,start
set so=10
" theme
set background=dark
"" using morhetz/gruvbox
autocmd vimenter * ++nested colorscheme gruvbox
" indentation
set expandtab
set shiftwidth=4
set tabstop=4
set autoindent
set smartindent
" change swap file locations to save git
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
"" keymaps
" make \\ comment out a line
au FileType vim nmap <buffer> \\ I" <Esc>
au FileType sh,zsh,csh,tcsh,make,py nmap <buffer> \\ I# <Esc>
au FileType html,xhtml,xml,xslt,dtd,xsd nmap <buffer> \\ I<!-- <Esc>A --><Esc>
au FileType sql,haskell nmap <buffer> \\ I-- <Esc>
au FileType c nmap <buffer> \\ I/* <Esc>A */<Esc>
au FileType cpp,rs,zig nmap <buffer> \\ I// <Esc>
au FileType * nmap <buffer> \\ 0i# <Esc>
"" document display
set conceallevel=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment