vim/vimrc

50 lines
2.7 KiB
VimL
Raw Normal View History

2018-01-28 09:37:14 +00:00
" Panthogen
call pathogen#infect()
" Autocmd
autocmd BufWritePre * %s/\s\+$//e " delete deprecated dots at very end of a line
2018-06-16 09:20:05 +00:00
autocmd Filetype make setlocal noexpandtab " use tabs in make files instead whitespaces
autocmd Filetype javascript setlocal shiftwidth=2 softtabstop=2 " javascript files
2021-05-13 10:02:32 +00:00
autocmd Filetype yaml setlocal shiftwidth=2 softtabstop=2 " yaml files
autocmd Filetype xml setlocal shiftwidth=2 softtabstop=2 " xml files
autocmd BufNewFile,BufRead rsnapshot.conf setlocal noexpandtab " use tabs in rsnapshot.conf files instead whitespaces
" Close NerdTree, if NerdTree is the last open buffer
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
2018-01-28 09:37:14 +00:00
2018-01-28 10:36:57 +00:00
" Key values
" Can do almost everything that set can do, plus more.
" It can assign a value to
let g:solarized_termcolors=256 " enable 256bit map for solarized colorschema
2018-01-28 10:36:57 +00:00
2018-01-28 09:37:14 +00:00
" Set options
2018-01-28 10:36:57 +00:00
" Only works with options
set autoindent " automatically indents text
2018-01-28 10:36:57 +00:00
set background=dark
set encoding=utf-8 " file encoding
2018-01-28 09:37:14 +00:00
set expandtab
2018-06-16 09:20:05 +00:00
set fileformat=unix " use unix fileformat (LF)
2018-09-13 13:09:46 +00:00
set list listchars=eol:$,tab:»·,trail" display dots for identicate tabspaces
set mouse=v " support mouse in visual mode
set nobackup " no backup files
set noswapfile " no swap files
set nowritebackup " only in case you don't want a backup file while editing
2018-02-17 16:35:23 +00:00
"set rnu " show row numbers from the position of the cursor
set nu " show row numbers from beginning
set statusline=%{fugitive#statusline()} " config my own statusline
2018-01-28 09:37:14 +00:00
set shiftwidth=2
set smarttab
set tabstop=2
set wildmenu
set wildmode=longest,list,full " autocompleteion bash
2018-01-28 09:37:14 +00:00
" Other
colorscheme solarized " colorschema
scriptencoding utf-8 " script encoding
syntax enable " enable syntaxhighlighting
2018-01-28 09:37:14 +00:00
2019-05-10 12:55:25 +00:00
" Shortcuts
com! FormatJSON %!python -m json.tool