dotfiles/.vimrc

97 lines
2.1 KiB
VimL

" #########################################################################
" use vim settings, rather than vi settings
" must be at start of vimrc as it changes other options as a side effect
set nocompatible
" make backspace behave in a sane manner
set backspace=indent,eol,start
" switch syntax highlighting on
syntax on
" sets options based on detected file type
filetype plugin on
" allow switching between buffers with unsaved changes
set hidden
set smartindent
set autoindent
set softtabstop=4
set tabstop=4
set shiftwidth=4
set expandtab
set number
set relativenumber
set showmatch
set nowrap
set smartcase
set noswapfile
set nobackup
set undodir=~/.vim/undodir
set undofile
set incsearch
" turn on full python highlighting
let python_highlight_all = 1
" netrw tweaks
let g:netrw_banner = 0 " disable annoying banner
let g:netrw_browse_split = 4 " open in prior window
let g:netrw_altv = 1 " open splits to the right
let g:netrw_liststyle = 3 " tree view
let g:netrw_winsize = -35
nmap <silent> <C-e> :Lexplore<CR>
"let g:netrw_list_hide=netrw_gitignore#Hide()
"let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
" set 256 colors and use specific color scheme
set t_Co=256
colorscheme calmar256-dark
set background=dark
" from no_plugins page (https://github.com/changemewtf/no_plugins)
set path+=**
set wildmenu
" enable vim plugins
" packages with plugins installed;
" - vim-airline
" - vim-airline-themes
" - vim-ale
" - vim-ctrlp
" airline package is enabled in /usr/share/vim/vimfiles/pack/dist-bundle/start
" packadd! airline
" from package vim-ale
packadd! ale
" from package vim-ctrlp
packadd! CtrlP
" disable folds at startup
set foldlevelstart=1
" set leader character to <Space>
let mapleader = "\<Space>"
" -----------Buffer Management---------------
" Move to the next buffer
nmap <leader>l :bnext<CR>
" Move to the previous buffer
nmap <leader>h :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <leader>q :bp <BAR> bd #<CR>
" Show all open buffers and their status
nmap <leader>bl :ls<CR>