dotfiles/vim/init.vim

103 lines
2.4 KiB
VimL
Raw Normal View History

2020-03-03 12:46:21 +01:00
call plug#begin('~/.config/vim-plugins')
Plug 'fatih/molokai'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'rodjek/vim-puppet'
Plug 'junegunn/goyo.vim'
Plug 'tpope/vim-fugitive'
Plug 'edkolev/tmuxline.vim'
Plug 'itchyny/lightline.vim'
Plug 'airblade/vim-gitgutter'
Plug 'junegunn/limelight.vim'
Plug 'hashivim/vim-terraform'
Plug 'bitc/vim-bad-whitespace'
call plug#end()
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
2020-02-07 12:45:22 +01:00
set splitbelow
set splitright
2016-06-15 13:55:21 +02:00
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
2020-02-05 16:19:10 +01:00
set termguicolors
2016-06-14 13:31:47 +02:00
2016-06-15 13:55:21 +02:00
set bs=2
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
2020-02-06 17:06:09 +01:00
set showtabline=2
2016-06-15 13:55:21 +02:00
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-03-03 12:46:21 +01:00
nmap <C-p> :Files ~<CR>
2020-02-05 15:33:34 +01:00
nmap <C-j> :term<CR>
2020-02-06 17:06:09 +01:00
nmap <C-n> :tabnew<CR>
2020-02-07 12:45:22 +01:00
nmap <C-q> :tabclose<CR>
2020-02-06 17:06:09 +01:00
nmap <C-Left> :tabprev<CR>
nmap <C-Right> :tabnext<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>
2020-02-12 12:33:45 +01:00
map <leader>n <Esc>:set nonumber! norelativenumber!<CR>
2016-06-14 13:31:47 +02:00
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>
2020-03-01 23:57:33 +01:00
map <leader>f <Esc>:Goyo<CR>
2020-03-03 12:46:21 +01:00
map <leader>t <Esc>:NERDTreeToggle<CR>
2016-06-14 13:31:47 +02:00
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
2020-02-29 10:20:32 +01:00
if has("gui")
2019-01-11 14:08:36 +01:00
set guioptions-=e
set guioptions-=r
set guioptions-=L
2020-03-01 23:57:33 +01:00
set guifont=Hack\ NF:h14
2019-01-11 14:08:36 +01:00
endif
2020-03-03 12:46:21 +01:00
filetype plugin indent on
2016-06-15 13:55:21 +02:00
2020-03-03 12:46:21 +01:00
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
2020-02-05 15:23:43 +01:00
command! -bang -nargs=? -complete=dir Files
2020-03-03 12:46:21 +01:00
\ call fzf#vim#files(<q-args>, {'options': ['-e', '--layout=reverse', '--height=20%', '--preview', 'bat --color=always --tabs=2 --style=plain --theme="Monokai Extended" {}']}, <bang>0)
2020-02-05 15:23:43 +01:00
2020-03-03 12:46:21 +01:00
let g:terraform_fmt_on_save=1
let g:lightline = {
2020-02-29 10:20:32 +01:00
\ 'colorscheme': 'powerlineish',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
2020-02-05 17:28:50 +01:00
\ [ 'fugitive', 'readonly', 'filename' ] ],
\ 'right': [ [ 'lineinfo' ],
\ [ 'percent' ],
2020-02-05 17:28:50 +01:00
\ [ 'filetype' ] ]
\ },
\ 'component_function': {
2020-02-06 17:06:09 +01:00
\ 'fugitive': 'FugitiveHead',
2020-02-29 10:20:32 +01:00
\ 'readonly': 'LightLineReadonly'},
\ }
function! LightLineReadonly()
2020-02-05 17:28:50 +01:00
return &readonly && &filetype !=# 'help' ? 'RO' : ''
endfunction