dotfiles/vim/init.vim

125 lines
3.0 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
2016-06-16 16:53:38 +02:00
set shell=sh
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+=(:),{:},[:],<:>,':',":"
2020-02-05 15:23:43 +01:00
nmap <tab> <C-w>w
2020-02-03 11:30:45 +01:00
nmap <Esc><CR> :wq!<CR>
2020-02-05 15:23:43 +01:00
nmap <C-p> :Files<CR>
2016-06-14 13:31:47 +02:00
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>
2020-02-03 11:30:45 +01:00
map <leader>gc <Esc>:Gcommit<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-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-14 17:06:28 +02:00
Plug 'bitc/vim-bad-whitespace'
2020-02-01 17:59:00 +01:00
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
2020-02-05 15:23:43 +01:00
Plug 'fatih/molokai'
2016-06-14 13:31:47 +02:00
call plug#end()
2016-06-15 14:27:30 +02:00
syntax on
2020-02-05 15:23:43 +01:00
colorscheme molokai
let g:rehash256=1
2016-06-15 13:55:21 +02:00
set background=dark
hi BadWhitespace ctermbg=lightblue guibg=lightblue
2019-01-11 14:08:36 +01:00
if has("gui_macvim")
set guioptions-=e
set guioptions-=r
set guioptions-=L
2019-11-22 00:35:58 +01:00
set guifont=Hack:h13
2019-01-11 14:08:36 +01:00
endif
2016-06-15 13:55:21 +02:00
2020-02-05 15:23:43 +01:00
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, {'options': ['-e', '--layout=reverse', '--height=80%', '--preview', 'bat --color=always --tabs=2 --style=plain --theme="Monokai Extended" {}']}, <bang>0)
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
2016-10-19 14:51:54 +02:00
let g:syntastic_puppet_puppetlint_args = "--no-80chars-check --no-autoloader_layout-check --no-nested_classes_or_defines-check --no-only_variable_string-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