From 6fd34606078050133e265de03edbc705917b9a79 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 14 Oct 2020 19:04:06 +0200 Subject: .vimrc in progress --- .vimrc | 341 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 178 insertions(+), 163 deletions(-) diff --git a/.vimrc b/.vimrc index cb45d67..bd5f49c 100644 --- a/.vimrc +++ b/.vimrc @@ -8,192 +8,207 @@ " Plugins call plug#begin('~/.vim/plugged') -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'preservim/nerdtree' -Plug 'mbbill/undotree' +Plug 'brglng/vim-sidebar-manager' Plug 'jiangmiao/auto-pairs' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-fugitive' +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' Plug 'luochen1990/rainbow' -Plug 'preservim/nerdcommenter' +Plug 'mbbill/undotree' +Plug 'mg979/vim-visual-multi' +Plug 'mhinz/vim-startify' Plug 'morhetz/gruvbox' -Plug 'sainnhe/gruvbox-material' -Plug 'ryanoasis/vim-devicons' -Plug 'brglng/vim-sidebar-manager' +Plug 'preservim/nerdtree' Plug 'preservim/tagbar' +Plug 'preservim/nerdcommenter' +Plug 'ryanoasis/vim-devicons' +Plug 'sainnhe/gruvbox-material' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-fugitive' Plug 'vifm/vifm.vim' -Plug 'mhinz/vim-startify' -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' -Plug 'mg979/vim-visual-multi' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' call plug#end() let mapleader="," " Some basics: - set bg=dark - set go=a - set mouse=a - set nohlsearch - set clipboard=unnamedplus - set tabstop=4 - set softtabstop=4 - set shiftwidth=4 - set nocompatible - filetype plugin indent on - set encoding=utf-8 - set number - set ruler - syntax on - set hidden - autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE - colorscheme gruvbox-material - set wildmode=longest,list,full - set makeprg=gmake +set bg=dark +set clipboard^=unnamedplus +set encoding=utf-8 +set go=a +set hidden +set makeprg=gmake +set mouse=a +set nocompatible +set nohlsearch +set number +set shiftwidth=4 +set softtabstop=4 +set ruler +set tabstop=4 +set wildmode=longest,list,full +syntax on +filetype plugin indent on +autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE +colorscheme gruvbox-material " Some quick bindings - nnoremap c "_c - nnoremap g :G - nnoremap :call NERDComment(0,"toggle") - nnoremap : - nnoremap :! - nnoremap :bprevious - nnoremap :bnext - nnoremap h - nnoremap j - nnoremap k - nnoremap l - nnoremap o - nnoremap 1 o - nnoremap 2 :sp - nnoremap 3 :vsp - nnoremap 0 q - nnoremap d :Vifm - nnoremap :w - nnoremap :Files - nnoremap :Buffers - nnoremap w :w :bp :bd # - nnoremap k :w :bp :bd # - nnoremap :spj:term:resize -10i - nnoremap :make-j5 - nnoremap u :UndotreeToggle - nmap 1 AirlineSelectTab1 - nmap 2 AirlineSelectTab2 - nmap 3 AirlineSelectTab3 - nmap 4 AirlineSelectTab4 - nmap 5 AirlineSelectTab5 - nmap 6 AirlineSelectTab6 - nmap 7 AirlineSelectTab7 - nmap 8 AirlineSelectTab8 - nmap 9 AirlineSelectTab9 - nmap 0 AirlineSelectTab10 +nnoremap c "_c +nnoremap g :G +nnoremap :call NERDComment(0,"toggle") +nnoremap : +nnoremap :! +nnoremap :bprevious +nnoremap :bnext +nnoremap h +nnoremap j +nnoremap k +nnoremap l +nnoremap o +nnoremap 1 o +nnoremap 2 :sp +nnoremap 3 :vsp +nnoremap 0 q +nnoremap d :Vifm +nnoremap :w +nnoremap :Files +nnoremap :Buffers +nnoremap w :w :bp :bd # +nnoremap k :w :bp :bd # +nnoremap :spj:term:resize -10i +nnoremap :make-j5 +nnoremap u :UndotreeToggle +nmap 1 AirlineSelectTab1 +nmap 2 AirlineSelectTab2 +nmap 3 AirlineSelectTab3 +nmap 4 AirlineSelectTab4 +nmap 5 AirlineSelectTab5 +nmap 6 AirlineSelectTab6 +nmap 7 AirlineSelectTab7 +nmap 8 AirlineSelectTab8 +nmap 9 AirlineSelectTab9 +nmap 0 AirlineSelectTab10 " sidebars - let g:NERDTreeWinPos = 'left' - let g:NERDTreeWinSize = 40 - let g:NERDTreeQuitOnOpen = 0 - let g:tagbar_left = 1 - let g:tagbar_width = 40 - let g:tagbar_autoclose = 0 - let g:tagbar_autofocus = 1 - let g:undotree_SetFocusWhenToggle = 1 - let g:undotree_SplitWidth = 40 - - let g:sidebars = { - \ 'nerdtree': { - \ 'position': 'left', - \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'nerdtree'}, - \ 'open': 'NERDTree', - \ 'close': 'NERDTreeClose' - \ }, - \ 'tagbar': { - \ 'position': 'left', - \ 'check_win': {nr -> bufname(winbufnr(nr)) =~ '__Tagbar__'}, - \ 'open': 'TagbarOpen', - \ 'close': 'TagbarClose' - \ }, - \ 'undotree': { - \ 'position': 'left', - \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'undotree'}, - \ 'open': 'UndotreeShow', - \ 'close': 'UndotreeHide' - \ } - \ } - - noremap :call sidebar#toggle('nerdtree') - noremap :call sidebar#toggle('tagbar') - noremap :call sidebar#toggle('undotree') - let g:startify_session_before_save = ['call sidebar#close_all()'] - - " Startify - let g:startify_padding_left = 90 - let g:startify_custom_header = startify#pad([ - \ ' _____________________________________ ', - \ ' / \', - \ ' | Hi, partner, welcome_back to |', - \ ' | _ __ ___ _____ _(_)_ __ ___ |', - \ ' | | ''_ \ / _ \/ _ \ \ / / | ''_ ` _ \ |', - \ ' | | | | | __/ (_) \ V /| | | | | | | |', - \ ' | |_| |_|\___|\___/ \_/ |_|_| |_| |_| |', - \ ' \ /', - \ ' ------------------------------------- ', - \ ' \ ^__^ ', - \ ' \ (oo)\_______ ', - \ ' (__)\ )\/\ ', - \ ' ||----w | ', - \ ' || || ', - \ ]) - let g:startify_lists = [ - \ { 'type': 'sessions', 'header': startify#pad(['Sessions']) }, - \ { 'type': 'files', 'header': startify#pad(['Recent']) }, - \ { 'type': 'bookmarks', 'header': startify#pad(['Bookmarks']) }, - \ { 'type': 'commands', 'header': startify#pad(['Commands']) }, - \ ] - let g:startify_bookmarks = [ - \ { 'v': '~/.vimrc' }, - \ { 'z': '~/.config/zsh/.zshrc' }, - \ { 'b': '~/.config/bspwm/bspwmrc' }, - \ ] +let g:NERDTreeWinPos = 'left' +let g:NERDTreeWinSize = 40 +let g:NERDTreeQuitOnOpen = 0 +let g:tagbar_left = 1 +let g:tagbar_width = 40 +let g:tagbar_autoclose = 0 +let g:tagbar_autofocus = 1 +let g:undotree_SetFocusWhenToggle = 1 +let g:undotree_SplitWidth = 40 + +let g:sidebars = { + \ 'nerdtree': { + \ 'position': 'left', + \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'nerdtree'}, + \ 'open': 'NERDTree', + \ 'close': 'NERDTreeClose' + \ }, + \ 'tagbar': { + \ 'position': 'left', + \ 'check_win': {nr -> bufname(winbufnr(nr)) =~ '__Tagbar__'}, + \ 'open': 'TagbarOpen', + \ 'close': 'TagbarClose' + \ }, + \ 'undotree': { + \ 'position': 'left', + \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'undotree'}, + \ 'open': 'UndotreeShow', + \ 'close': 'UndotreeHide' + \ } + \ } + +noremap :call sidebar#toggle('nerdtree') +noremap :call sidebar#toggle('tagbar') +noremap :call sidebar#toggle('undotree') +let g:startify_session_before_save = ['call sidebar#close_all()'] + +" Startify +" let g:startify_padding_left = 90 +let g:startify_custom_header = startify#pad([ + \ ' _____________________________________ ', + \ ' / \', + \ ' | Hi, partner, welcome_back to |', + \ ' | _ __ ___ _____ _(_)_ __ ___ |', + \ ' | | ''_ \ / _ \/ _ \ \ / / | ''_ ` _ \ |', + \ ' | | | | | __/ (_) \ V /| | | | | | | |', + \ ' | |_| |_|\___|\___/ \_/ |_|_| |_| |_| |', + \ ' \ /', + \ ' ------------------------------------- ', + \ ' \ ^__^ ', + \ ' \ (oo)\_______ ', + \ ' (__)\ )\/\ ', + \ ' ||----w | ', + \ ' || || ', + \ ]) +let g:startify_lists = [ + \ { 'type': 'sessions', 'header': startify#pad(['Sessions']) }, + \ { 'type': 'files', 'header': startify#pad(['Recent']) }, + \ { 'type': 'bookmarks', 'header': startify#pad(['Bookmarks']) }, + \ { 'type': 'commands', 'header': startify#pad(['Commands']) }, + \ ] +let g:startify_bookmarks = [ + \ { 'v': '~/.vimrc' }, + \ { 'z': '~/.config/zsh/.zshrc' }, + \ { 'b': '~/.config/bspwm/bspwmrc' }, + \ ] " Airline - let g:airline#extensions#tabline#enabled = 1 - let g:airline#extensions#tabline#fnamemod = ':t' - let g:airline_detect_modified = 1 - let g:airline_detect_paste = 1 - let g:airline_detect_crypt = 1 - let g:airline_theme = 'base16_gruvbox_dark_hard' - let g:airline_powerline_fonts = 1 - let g:airline_symbols_ascii = 1 - let g:airline#parts#ffenc#skip_expected_string = 'utf-8[unix]' +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#fnamemod = ':t' +let g:airline_detect_modified = 1 +let g:airline_detect_paste = 1 +let g:airline_detect_crypt = 1 +let g:airline_theme = 'base16_gruvbox_dark_hard' +let g:airline_powerline_fonts = 1 +let g:airline_symbols_ascii = 1 +let g:airline#parts#ffenc#skip_expected_string = 'utf-8[unix]' " Rainbow - let g:rainbow_active = 1 +let g:rainbow_active = 1 " NERD Commenter - let g:NERDSpaceDelims = 1 - let g:NERDCompactSexyComs = 1 - let g:NERDDefaultAlign = 'left' - let g:NERDAltDelims_java = 1 - let g:NERDCustomDelimiters = { 'c': { 'left': '/*','right': '*/' } } - let g:NERDCommentEmptyLines = 1 - let g:NERDTrimTrailingWhitespace = 1 - let g:NERDToggleCheckAllLines = 1 +let g:NERDSpaceDelims = 1 +let g:NERDCompactSexyComs = 1 +let g:NERDDefaultAlign = 'left' +let g:NERDAltDelims_java = 1 +let g:NERDCustomDelimiters = { 'c': { 'left': '/*','right': '*/' } } +let g:NERDCommentEmptyLines = 1 +let g:NERDTrimTrailingWhitespace = 1 +let g:NERDToggleCheckAllLines = 1 " Cursor mode - let g:airline#extensions#cursormode#enabled = 1 - let g:cursormode_color_map = { - \ "i": "#d79921", - \ "n": "#d79921", - \ "R": "#cc241d", - \ "r": "#cc241d", - \ "v": "#b06597", - \ "V": "#b06597", - \ "\": "#b06597", - \} +let g:airline#extensions#cursormode#enabled = 1 +let g:cursormode_color_map = { + \ "i": "#d79921", + \ "n": "#d79921", + \ "R": "#cc241d", + \ "r": "#cc241d", + \ "v": "#b06597", + \ "V": "#b06597", + \ "\": "#b06597", + \} " 10 buffers jump - let g:airline#extensions#tabline#buffer_idx_mode = 1 +let g:airline#extensions#tabline#buffer_idx_mode = 1 " Disables automatic commenting on newline: - autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o + +" Filetype {{{1 +augroup vimrc + " Filetype: Assembly {{{2 + let g:asmsyntax = 'asm' + " Filetype: C {{{2 + autocmd BufLeave *.{c,cpp} mark C + autocmd BufLeave *.h mark H + + " Filetype: Perl {{{2 + let perl_include_pod = 1 + autocmd FileType perl + \ setlocal com-=:# kp=perldoc\ -f + \| compiler perl +augroup END -- cgit v1.2.3