From: Jannik ZANDER Date: Sat, 14 May 2016 11:46:14 +0000 (+0200) Subject: Add sections in .vimrc X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=1a43e44fc4aa682fd98690d7f4d70ba1c1f744b0;p=dotfiles.git Add sections in .vimrc --- diff --git a/.bashrc b/.bashrc index 42d780a..d1bb2d7 100644 --- a/.bashrc +++ b/.bashrc @@ -28,12 +28,3 @@ done; # Local/private settings [ -f "${HOME}/.bashrc_local" ] && source "${HOME}/.bashrc_local" - - -[ -f ~/.fzf.bash ] && source ~/.fzf.bash - -PATH="/Users/jannikz/perl5/bin${PATH:+:${PATH}}"; export PATH; -PERL5LIB="/Users/jannikz/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="/Users/jannikz/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; -PERL_MB_OPT="--install_base \"/Users/jannikz/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE=/Users/jannikz/perl5"; export PERL_MM_OPT; diff --git a/.vimrc b/.vimrc index 3a01c35..21ebfd0 100644 --- a/.vimrc +++ b/.vimrc @@ -1,7 +1,6 @@ -set nocompatible - -"-----------plugin manager---------------- +" ~/.vimrc +set nocompatible if empty(glob('$HOME/.vim/autoload/plug.vim')) silent !curl -fLo $HOME/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim @@ -10,58 +9,82 @@ endif call plug#begin('$HOME/.vim/plugged') -Plug 'tpope/vim-sensible' -Plug 'tpope/vim-ragtag' +"Plug 'tpope/vim-sensible' +"Plug 'tpope/vim-ragtag' Plug 'tpope/vim-repeat' Plug 'tpope/vim-surround' Plug 'tpope/vim-fugitive' -Plug 'altercation/vim-colors-solarized' "Plug 'vim-airline/vim-airline' "Plug 'vim-airline/vim-airline-themes' -Plug 'mileszs/ack.vim' +"Plug 'mileszs/ack.vim' Plug 'brandonbloom/csearch.vim' Plug 'chazy/cscope_maps' -"Plug 'vim-scripts/taglist.vim' +Plug 'majutsushi/tagbar' "Plug 'airblade/vim-gitgutter' -Plug 'junegunn/fzf.vim' -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +"Plug 'junegunn/fzf.vim' Plug 'thanthese/Tortoise-Typing' +Plug 'altercation/vim-colors-solarized' call plug#end() -"--------------------------------------------- +" Section: Options {{{1 +" --------------------- -" For color -set background=dark -let g:solarized_menu=0 -try - colorscheme solarized -catch - colorscheme default -endtry +set autoindent +set autoread +set autowrite " Automatically save before commands like :next and :make +set backspace=2 +if exists('+breakindent') + set breakindent showbreak=\ + +endif +set cmdheight=2 +setglobal commentstring=#\ %s +set complete-=i " Searching includes can be slow +set fileformats=unix,dos,mac +set foldmethod=marker +set foldopen+=jump +set history=200 +set incsearch " Incremental search +set laststatus=2 " Always show status line +set lazyredraw +set linebreak +set mouse=nvi +set mousemodel=popup +set pastetoggle= +set printoptions=paper:letter +set scrolloff=1 +set shiftround +set showcmd " Show (partial) command in status line. +set showmatch " Show matching brackets. +set sidescrolloff=5 +set smartcase " Case insensitive searches become sensitive with capitals +set smarttab " sw at the start of the line, sts everywhere else +setglobal tags=./tags; +set timeoutlen=1200 " A little bit more time for macros +set ttimeoutlen=50 " Make Esc work faster +if exists('+undofile') + set undofile +endif +set visualbell +set virtualedit=block +set wildmenu +set wildmode=longest:full,full +set wildignore+=tags,.*.un~,*.pyc +set winaltkeys=no -" For fonts -if has("gui_running") - if has("gui_gtk2") - set guifont=Inconsolata\ 12 - elseif has("gui_macvim") - set guifont=Monaco:h11 - elseif has("gui_win32") - set guifont=Consolas:h11 - endif +if !has("gui_running") && $DISPLAY == '' || !has("gui") + set mouse= endif +set background=dark -" For markdown -autocmd BufNewFile,BufReadPost *.md set filetype=markdown + +" Plugin Settings {{{2 + + +let g:solarized_menu=0 let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] let g:markdown_syntax_conceal = 0 -" For taglist -"let Tlist_Compact_Format = 1 -"let Tlist_GainFocus_On_ToggleOpen = 1 -"let Tlist_Close_On_Select = 1 -"nnoremap :TlistToggle - " %s is replaced with fzf command "let g:fzf_launcher = 'xterm -e bash -ic %s' let g:fzf_launcher = "In_a_new_term_function %s" @@ -69,12 +92,69 @@ let g:fzf_launcher = "In_a_new_term_function %s" "For airline "let g:airline#extensions#tabline#enabled = 1 -" Easy escape +" }}}2 +" Section: Commands {{{1 +" ----------------------- +" +" +" Section: Mappings {{{1 +" ---------------------- + inoremap jj inoremap j j +map +map! +if has("gui_running") + map :Fancy +endif +nmap :if &previewwindowpcloseelseif exists(':Gstatus')exe 'Gstatus'elselsendif +nmap :if exists(':Lcd')exe 'Lcd'elseif exists(':Cd')exe 'Cd'elselcd %:hendif +map :Make +map :Dispatch +map :Start +map v :so ~/.vimrc + + +" Section: Autocommands {{{1 +" -------------------------- +if has("autocmd") + filetype plugin indent on +autocmd BufNewFile,BufReadPost *.md set filetype=markdown +endif " has("autocmd") +" }}}1 +" Section: Visual {{{1 +" -------------------- + +" Switch syntax highlighting on, when the terminal has colors +if (&t_Co > 2 || has("gui_running")) && has("syntax") + function! s:initialize_font() + if exists("&guifont") + if has("mac") + set guifont=Monaco:h12 + elseif has("unix") + if &guifont == "" + set guifont=Monospace\ Medium\ 12 + endif + elseif has("gtk2") + set guifont=Inconsolata\ 12 + elseif has("win32") + set guifont=Consolas:h11,Courier\ New:h10 + endif + endif + endfunction + + + if exists("syntax_on") || exists("syntax_manual") + else + syntax on + endif + set list + if !exists('g:colors_name') + silent! colorscheme solarized + endif + endif +" }}}1 -" For local/private settings -let $LOCALFILE=expand("$HOME/.vimrc_local") -if filereadable($LOCALFILE) -source $LOCALFILE +if filereadable(expand("$HOME/.vimrc_local")) + source $HOME/.vimrc_local endif