1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | " .vimrc by Miika Nissi
" https://github.com/miikanissi
" https://miikanissi.com
" language specific configs at .vim/ftplugin/<language>.vim
" or .vim/after/ftplugin/<language>.vim to not override defaults only add to
" variables
let $RTP=split(&runtimepath, ',')[0]
let $RC="$HOME/.vim/vimrc"
" basics
filetype plugin indent on
syntax on
highlight ColorColumn ctermbg=0 guibg=lightgrey
colorscheme base16-hopscotch
let g:lightline = {
\ 'colorscheme': 'wombat',
\ }
" settings
set backspace=indent,eol,start " normal backspace functionality
set hidden " hides instead of unloads buffers
set path=.,** " path is cur file and dir
set wildmenu " tab complete shows all matching files
set nocompatible " compatibility vim only
set clipboard=unnamed " uses system clipboard
set noerrorbells " no error bells
set tabstop=4 softtabstop=4 " default tabs
set shiftwidth=4 " default shift
set expandtab " default tabs
set smartindent " default tabs
set nu " line numbers
set wrap " no wrap
set ignorecase " ignores case in search
set smartcase " uses smartcase in search
set noswapfile " no swap file
set nobackup " no backup file
" set undodir=~/.vim/undodir " undo dir
" set undofile " makes undofiles
set incsearch " incremental search enabled
set ruler " ruler shows cur pos
set modelines=0 " no modelines
set colorcolumn=80 " colorcolumn is 80
set lazyredraw " no redraw
set magic " magic for regex
set scrolloff=5 " shows 5 lines under mouse
set matchpairs+=<:> " highlights matching brackets, '%' to jump between them
set viminfo='100,<9999,s100 " only stores info from 100 files at a time, 9999 lot.
set laststatus=2 " allows lightline to show
set noshowmode " -- INSERT -- is not shown as lightline shows it
let skip_defaults_vim=1 " disable viminfo
set viminfo="" " disable viminfo
set showcmd " shows the typed command
" file browsing tweaks netrw-browse-maps for mappings
let g:netrw_banner=0 " disable banner
let g:netrw_browse_split=4 " open in prior window
let g:netrw_altv=1 " open splits to right
let g:netrw_liststyle=3 " tree view
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
let g:netrw_dirhistmax=0 " no .netrwhist file
" defines leader key as comma
let mapleader = ","
" snippets
nnoremap <leader>html :-1read $HOME/.vim/snippets/skeleton.html<CR>5jwf>a
nnoremap <leader>cc :-1read $HOME/.vim/snippets/skeleton.c<CR>4ji<tab>
nnoremap <leader>cpp :-1read $HOME/.vim/snippets/skeleton.cpp<CR>4ji<tab>
" terminal commands
command! MakeTags !ctags -R . " recursively creates ctags in directory
|
x
Notes
Github: https://github.com/miikanissi/dotfiles
You can find my other dotfiles and scripts I use there.
This is a pretty basic vimrc with only one plugin, lightline.