dotfiles/vim/init.vim

120 lines
2.7 KiB
VimL
Raw Normal View History

2016-06-15 13:55:21 +02:00
set title
set number
2016-06-14 13:31:47 +02:00
set gdefault
2016-06-15 13:55:21 +02:00
set wildmenu
2016-06-14 13:31:47 +02:00
set nobackup
set incsearch
2016-06-15 13:55:21 +02:00
set expandtab
set smartcase
set ignorecase
2016-06-14 13:31:47 +02:00
set nohlsearch
2016-06-15 13:55:21 +02:00
set noshowmode
set autoindent
set shiftround
set cursorline
set cursorcolumn
2016-06-14 13:31:47 +02:00
set nojoinspaces
set nowritebackup
2016-06-15 13:55:21 +02:00
set bs=2
set diffopt+=vertical
2016-06-15 13:55:21 +02:00
set tabstop=2
set scrolloff=5
2016-06-14 13:31:47 +02:00
set laststatus=2
2016-06-15 13:55:21 +02:00
set shiftwidth=2
set softtabstop=2
2016-06-14 13:31:47 +02:00
set winminheight=0
2016-06-15 13:55:21 +02:00
set backspace=eol,start,indent
2016-06-14 13:31:47 +02:00
set matchpairs+=(:),{:},[:],<:>,':',":"
nmap <tab> w
nmap  :wq!
map <leader>b <Esc>:set cc=79<CR>
map <leader>nb <Esc>:set cc=0<CR>
map <leader>n <Esc>:set nonumber!<CR>
map <leader>\ <Esc>:setlocal nospell<CR>
map <leader>pl <Esc>:setlocal spell spelllang=pl<CR>
map <leader>en <Esc>:setlocal spell spelllang=en_gb<CR>
map <leader>p <Esc>:set paste!<CR>
map <leader>g <Esc>:Gstatus<CR>
2016-06-15 15:21:51 +02:00
map <leader>gp <Esc>:Gpush<CR>
2016-06-14 13:31:47 +02:00
au BufRead,BufNewFile *.pp
\ set filetype=puppet
filetype plugin indent on
2016-06-14 13:49:11 +02:00
call plug#begin('~/.config/vim-plugins')
2016-06-14 13:31:47 +02:00
Plug 'godlygeek/tabular'
2016-06-14 15:19:22 +02:00
Plug 'rodjek/vim-puppet'
Plug 'ctrlpvim/ctrlp.vim'
2016-06-15 14:16:56 +02:00
Plug 'tpope/vim-fugitive'
2016-06-15 14:52:48 +02:00
Plug 'scrooloose/syntastic'
2016-06-14 13:31:47 +02:00
Plug 'edkolev/tmuxline.vim'
Plug 'itchyny/lightline.vim'
2016-06-15 13:55:21 +02:00
Plug 'brendonrapp/smyck-vim'
2016-06-14 17:06:28 +02:00
Plug 'bitc/vim-bad-whitespace'
2016-06-14 13:31:47 +02:00
call plug#end()
2016-06-15 14:27:30 +02:00
syntax on
2016-06-15 13:55:21 +02:00
colorscheme smyck
set background=dark
hi BadWhitespace ctermbg=lightblue guibg=lightblue
2016-06-15 14:27:30 +02:00
if has("gui_running")
set guioptions-=e
set guioptions-=r
set guioptions-=L
2016-06-16 15:42:08 +02:00
set guifont=MesloLGSDZ\ Nerd\ Font:h12
2016-06-15 14:27:30 +02:00
endif
2016-06-15 15:09:16 +02:00
let g:syntastic_auto_jump = 1
let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_puppet_puppetlint_args = "--no-80chars-check --no-autoloader_layout-check --no-nested_classes_or_defines-check"
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ],
\ 'right': [ [ 'lineinfo' ],
\ [ 'percent' ],
2016-06-16 14:36:33 +02:00
\ [ 'fileencoding' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'readonly': 'LightLineReadonly',
\ 'modified': 'LightLineModified'
\ },
\ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
\ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" },
\ 'tabline_separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
\ 'tabline_subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
\ }
function! LightLineModified()
if &filetype == "help"
return ""
elseif &modified
return "+"
elseif &modifiable
return ""
else
return ""
endif
endfunction
function! LightLineReadonly()
if &filetype == "help" || &filetype == "gitcommit"
return ""
elseif &readonly
return ""
else
return ""
endif
endfunction
function! LightLineFugitive()
return exists('*fugitive#head') ? fugitive#head() : ''
endfunction