From 79af20a16fe10b424e4fe5865d49d8e9323f77e3 Mon Sep 17 00:00:00 2001 From: "Allan W. Nielsen" Date: Sun, 21 Jun 2020 10:21:50 +0200 Subject: [PATCH] misc updates --- gitconfig | 2 + tmux.conf | 2 +- vimrc | 262 +++++++++++++++++++++++++++++------------------------- 3 files changed, 144 insertions(+), 122 deletions(-) diff --git a/gitconfig b/gitconfig index 0ef4dee..0820d60 100644 --- a/gitconfig +++ b/gitconfig @@ -86,5 +86,7 @@ smtpserverport = 587 smtpencryption = tls smtpuser = a@awn.dk + [push] default = simple + diff --git a/tmux.conf b/tmux.conf index fd075af..8db5aa7 100644 --- a/tmux.conf +++ b/tmux.conf @@ -45,7 +45,7 @@ bind f next-window #bind j up-pane #bind k down-pane -set-option -g status-utf8 on +#set-option -g status-utf8 on # set-option -g status-justify centre set-option -g status-justify left set-option -g status-bg blue diff --git a/vimrc b/vimrc index 001d7e0..3655556 100644 --- a/vimrc +++ b/vimrc @@ -1,43 +1,109 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Loading u-pathogen -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -execute pathogen#infect() +"***************************************************************************** +"" Vim-PLug core +"***************************************************************************** +if has('vim_starting') + set nocompatible " Be iMproved +endif + +let vimplug_exists=expand('~/.vim/autoload/plug.vim') + +let g:vim_bootstrap_langs = "c,perl,ruby" +let g:vim_bootstrap_editor = "vim" " nvim or vim + +if !filereadable(vimplug_exists) + echo "Installing Vim-Plug..." + echo "" + silent !\curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + let g:not_finish_vimplug = "yes" + + autocmd VimEnter * PlugInstall +endif + +" Required: +call plug#begin('~/.vim/plugged') +Plug 'vim-scripts/tlib' " Utility library +Plug 'tpope/vim-sensible' " Basic vim settings +Plug 'godlygeek/csapprox' " Fixes color schema +"Plug 'flazz/vim-colorschemes' " Lots of color schems +"Plug 'rakr/vim-one' +"Plug 'nightsense/vimspectr' +"Plug 'felixhummel/setcolors.vim' " Easy browsing of color schema +" +"Plug 'SirVer/ultisnips' " Snippet engine +"Plug 'honza/vim-snippets' +" +"Plug 'vim-ruby/vim-ruby' " Better ruby support +"Plug 'rhysd/vim-clang-format' " Clang format + +Plug 'vim-scripts/csindent.vim' " Project specific settings +Plug 'vim-scripts/FSwitch' " Easy switching between header and c files +Plug 'vim-scripts/highlight.vim' " Highlight lines + +" Plug 'cloudhead/neovim-fuzzy' + +" Plug 'asciidoc/vim-asciidoc' +Plug 'vim-scripts/SyntaxRange' +Plug 'dahu/vimple' +Plug 'dahu/Asif' +Plug 'dahu/vim-asciidoc' + +Plug 'tpope/vim-tbone' " Access copy-paster buffer in tmux +Plug 'tpope/vim-repeat' " Just make '.' work as it used to +Plug 'tpope/vim-fugitive' " Git plugin +Plug 'tpope/vim-unimpaired' " short-cuts for cnext/cprev and other +Plug 'tpope/vim-speeddating' " Make / work for dates (as well) +Plug 'tpope/vim-characterize' +Plug 'airblade/vim-gitgutter' +Plug 'vim-airline/vim-airline' " Fancy status line, must come after fugitive + +" Plug 'neomutt/neomutt.vim' + + +"Plug 'altercation/vim-colors-solarized' +"Plug 'endel/vim-github-colorscheme' +"Plug 'morhetz/gruvbox' +"Plug 'NLKNguyen/papercolor-theme' + + + +"let g:make = 'gmake' +"if exists('make') +" let g:make = 'make' +"endif +"Plug 'Shougo/vimproc.vim', {'do': g:make} +" +"if v:version >= 703 +" Plug 'Shougo/vimshell.vim' +"endif + +call plug#end() -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Basic Settings -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set nocompatible " Setting an incompatible mode -"set exrc " Search settings in local files -syntax on " Turn on syntax highlighting -filetype on " Support for automatic file type detection -filetype plugin on " Support for automatic loading of plugins for the file type -filetype indent on " Support for automatic download script odsadzovacieho -set history=1000 " Set Command History set ttyfast " Optimize for quick connection terminal - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vim UI -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -set backspace=2 " Allows backspacing over indentation, end-of-line, and start-of-line. -set ruler " Show cursor position -set shortmess=atI " Kind of messages to show. Abbreviate them all! -set showcmd " Show current uncompleted command? Absolutely! -set showfulltag " Auto completion (great for programming) -set splitbelow " Create new window below current one. -set cmdheight=1 " The command bar high set number " Turn on line numbers set lazyredraw " Do not redraw while running macros (much faster) -set conceallevel=2 " Enable Wrapping characters -set concealcursor=vin -set scrolloff=3 " Scroll before the curser reaches top or buttom +set scrolloff=5 " Scroll before the curser reaches top or buttom set sidescrolloff=2 " Scroll before the curser reaches left or right side set textwidth=80 " Set the line width to 80 characters autocmd FileType c,cpp setlocal colorcolumn=80 " Setting highlight long lines set hidden " Allow edit buffers to be hidden set guioptions= " Remove menus -"set mouse=a " Enable mouse scrolling, mouse selection etc. + colorscheme evening " This is a nice color scheame -set laststatus=2 " Always view the status bar +"colorscheme github +"colorscheme solarized + +if empty($BG) + set bg=dark +else + set bg=$BG +endif + +"let g:gruvbox_contrast_dark='hard' +"let g:gruvbox_contrast_light='hard' +"colorscheme gruvbox +"colorscheme PaperColor if has("multi_byte") set fillchars=stl:\ ,stlnc:\ ,vert:┆,fold:-,diff:- " Displaying symbols to separate windows @@ -52,7 +118,6 @@ if has("gui_running") endif endif - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Visual Cues """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -61,37 +126,25 @@ set hlsearch " highlight search - show the current search pattern set incsearch " Do the search while typing in a search pattern set ignorecase " Ignore cases while searching set showmatch " showmatch: Show the matching bracket for the last ')'? -set lazyredraw " Speed up macros - -" Use the cool tab complete menu -set wildmenu -set wildmode=list:longest,full -set wildignore=*.o,*~ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Text Formatting/Layout """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set autoindent " Auto indent, nice for coding set smartindent " Do smart autoindenting when starting a new line. -"set cindent " cindent: do c-style indenting autocmd FileType c,cpp setlocal cindent set copyindent " Mirroring offset with automatic indentation set shiftwidth=4 " Number of spaces to use for each insertion of (auto)indent. set tabstop=8 " Number of spaces that a in the file counts for -"set smarttab " Use tabs at the start of a line, spaces elsewhere set expandtab " Expand Tabs (use spaces)?. -set formatoptions=tcrqn " See Help (complex) +set formatoptions=tcrqnj " See Help (complex) set linebreak " Insert automatic line breaks while typing set nowrap " No wrap while displaying long lines set cinoptions=h2,l2,g2,t0,i8,+8,(0,w1,W8,N-s - - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Storage """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -"set backup " Auto backup files -"set backupdir=~/.vim/backup,.,~/ " Automatically back up the following directories set directory=~/.vim/tmp,~/tmp,.,/tmp " Set the temporary directory set confirm " Instead of an error message at the end of the editor asks whether to change Saved set viminfo='100000,f1,:100000,/100000 " Setting File viminfo @@ -100,59 +153,9 @@ set undofile " Set the file name to undo - automatically set undolevels=1024 " The number of changes that can be returned set undoreload=65538 " The maximum number of lines that can be saved in the undo buffer RELOADE -" Snippets -let g:UltiSnipsNoPythonWarning = 1 -let g:UltiSnipsUsePythonVersion = 2 -let g:UltiSnipsSnippetsDir="~/.vim/bundle/ultisnips/UltiSnips" -let g:UltiSnipsEditSplit="horizontal" - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Autocomplete -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -"let g:clang_snippets=1 -"let g:clang_conceal_snippets=1 -let g:clang_use_library=1 -let g:clang_library_path="/usr/lib64" -let g:clang_user_options = '-std=c++11' -"let g:clang_auto_user_options="compile_commands.json" -let g:clang_hl_errors=1 -let g:clang_complete_copen=1 -let g:clang_snippets_engine='clang_complete' - -let g:clang_periodic_quickfix=0 -map :call g:ClangUpdateQuickFix() - -let g:clang_format#code_style = "google" -let g:clang_format#auto_format_on_insert_leave = 0 -let g:clang_format#auto_formatexpr = 0 -let g:clang_format#style_options = { - \ "AccessModifierOffset" : -2, - \ "MaxEmptyLinesToKeep" : 3, - \ "ContinuationIndentWidth" : 8, - \ "IndentCaseLabels" : "false", - \ "Standard" : "C++11" } - -map :ClangFormat - - - -" Limit popup menu height -set pumheight=20 - -"set completeopt=menuone,menu -set completeopt=menuone,menu,preview -" | | | -" | | + Uses the preview window -" | + Show popup menu for complementarity -" + View menu even if only one match - -" Auto close the preview pane by moving the cursor -"autocmd CursorMovedI * if pumvisible() == 0|pclose|endif -"autocmd InsertLeave * if pumvisible() == 0|pclose|endif - -" Topping up by pressing Ctrl + Space -imap -imap +" Bash like tab completion +set wildmode=longest,list,full +set wildmenu """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Plugins @@ -162,41 +165,58 @@ imap let g:Powerline_symbols="fancy" let g:Powerline_theme="default" let g:Powerline_colorscheme="default" - - -" View mini buffer explorer -map :call BufferList() - +let g:airline_powerline_fonts = 1 " use gid for grepping set grepprg=gid set grepformat=%f:%l:%m -autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 -autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 -autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 - -let g:DoxygenToolkit_briefTag_pre="\\brief " -let g:DoxygenToolkit_paramTag_pre="\\param " -let g:DoxygenToolkit_returnTag="\\return " -let g:DoxygenToolkit_authorName="Allan W. Nielsen" -let g:DoxygenToolkit_compactOneLineDoc="yes" -let g:DoxygenToolkit_compactDoc="yes" - autocmd BufEnter * :syntax sync minlines=1000 -au! BufEnter */vtss_basics/src/*.cxx let b:fswitchdst = 'hxx' | let b:fswitchlocs = 'reg:|src|include/vtss/basics|' -au! BufEnter */vtss_basics/src/*/*.cxx let b:fswitchdst = 'hxx' | let b:fswitchlocs = 'reg:|src|include/vtss/basics|' -au! BufEnter */vtss_basics/src/*/*/*.cxx let b:fswitchdst = 'hxx' | let b:fswitchlocs = 'reg:|src|include/vtss/basics|' -au! BufEnter */vtss_basics/src/*/*/*/*.cxx let b:fswitchdst = 'hxx' | let b:fswitchlocs = 'reg:|src|include/vtss/basics|' -au! BufEnter */vtss_basics/include/vtss/basics/*.hxx let b:fswitchdst = 'cxx' | let b:fswitchlocs = 'reg:/include.vtss.basics/src/' -au! BufEnter */vtss_basics/include/vtss/basics/*/*.hxx let b:fswitchdst = 'cxx' | let b:fswitchlocs = 'reg:/include.vtss.basics/src/' -au! BufEnter */vtss_basics/include/vtss/basics/*/*/*.hxx let b:fswitchdst = 'cxx' | let b:fswitchlocs = 'reg:/include.vtss.basics/src/' -au! BufEnter */vtss_basics/include/vtss/basics/*/*/*/*.hxx let b:fswitchdst = 'cxx' | let b:fswitchlocs = 'reg:/include.vtss.basics/src/' - " The transition to alternative buffer (eg, from the header file to cpp and vice versa) map :FSHere imap :FSHere +if ! has('gui_running') + set ttimeoutlen=10 + augroup FastEscape + autocmd! + au InsertEnter * set timeoutlen=0 + au InsertLeave * set timeoutlen=1000 + augroup END +endif -let g:tex_conceal = "" +set diffexpr=MyDiff() +function MyDiff() + let opt = "" + if &diffopt =~ "icase" + let opt = opt . "-i " + endif + if &diffopt =~ "iwhite" + let opt = opt . "-b " + endif + silent execute "!diff -d -a --binary " . opt . v:fname_in . " " . v:fname_new . + \ " > " . v:fname_out +endfunction + +let g:xml_syntax_folding=1 +au FileType xml setlocal foldmethod=syntax + +" To map to exit terminal-mode: +tnoremap + +" To use `ALT+{h,j,k,l}` to navigate windows from any mode: +tnoremap h +tnoremap j +tnoremap k +tnoremap l +inoremap h +inoremap j +inoremap k +inoremap l +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +nnoremap :FuzzyOpen