" The .vimrc of laumann, written from scratch " For some reason, the comment syntax is " and not #, but whatever. " set relativenumber " set number set encoding=utf8 set ffs=unix,dos,mac set title set nocompatible " We're running Vim, no Vi! filetype on " Enable filetype detection filetype indent on " Enable filetype-specific indenting filetype plugin on " Enable filetype-specific plugins set incsearch set hlsearch set tabstop=8 " Number of spaces per tab set softtabstop=8 " Number of spaces to insert when pressing tab " set expandtab " tabs are spaces, pressing inserts spaces set smarttab set autoindent " set number set ruler set ai " Auto indent set si " Smart indent set hidden " Allow switching from buffers with unsaved changes " Smart defaults set showmatch " Show matching [, { and ( set showcmd " set list set listchars=tab:▸\ if has("wildmenu") set wildmenu set wildmode=list,full " set up ignores set wildignore+=*.a,*.o set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png set wildignore+=.git,.hg,.svn set wildignore+=*~,*.swp,*.tmp endif set formatoptions+=t set textwidth=80 set laststatus=2 " Always show the status line "set statusline=%f\ %L\ %y%=L%-4l\ C%-4c\ set statusline=\ %F%m%r%h\ %w\ %y\ \ CWD:\ %r%{getcwd()}%h\ \ \ L%4l/%-4L\ C%-4c\ \ %P " Learning Vim the hard way " Mapping arrow keys to to prevent myself from using them inoremap inoremap inoremap inoremap " Plugins managed by vim-plug call plug#begin('~/.vim/plugged') Plug 'rust-lang/rust.vim' Plug 'racer-rust/vim-racer' Plug 'wincent/command-t' " Color themes " Plug 'pbrisbin/vim-colors-off' " Plug 'andreypopp/vim-colors-plain' " Plug 'liuchengxu/space-vim-dark' Plug 'vim-airline/vim-airline' Plug 'mbbill/undotree' Plug 'ewilazarus/preto' Plug 'pgdouyon/vim-yin-yang' Plug 'lurst/austere.vim' Plug '/usr/bin/fzf' call plug#end() "colorscheme off "set bg=dark " Leader " So the leader is somewhere you can add custom commands with time - good to " know. " " As a minimum, let the leader be "," - maybe space might even be a good choice let mapleader = "," nnoremap W :%s/\s\+$//:let @/='' nnoremap w :w nnoremap s :source ~/.vimrc nnoremap / :nohlsearch " Use CommandTJump to switch buffers nnoremap tb :CommandTJump " FZF nnoremap f :FZF " Undotree nnoremap ut :UndotreeToggle nnoremap uf :UndotreeFocus " cscope for Linux kernel development if has("cscope") if filereadable("cscope.out") cs add cscope.out endif set csto=0 " Add mappings noremap csg :cs find g =expand("") " Find definition noremap css :cs find s =expand("") " Find C symbol noremap csd :cs find d =expand("") " Find functions called by this function noremap csc :cs find c =expand("") " Find callers endif autocmd BufNewFile,BufRead COMMIT_EDITMSG syntax on if has("gui_running") " No: scrollbars, menu, toolbar set guioptions-=L set guioptions-=b set guioptions-=r set guioptions-=m set guioptions-=T " Set font " set guifont=Inconsolata\ Regular\ 12 set guifont=Hack\ 10 " Open NERDTree " autocmd VimEnter * NERDTree endif syntax off highlight Visual term=reverse ctermbg=159