Skip to content

Commit

Permalink
misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
allannielsen committed Jun 21, 2020
1 parent fe1f567 commit 79af20a
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 122 deletions.
2 changes: 2 additions & 0 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@
smtpserverport = 587
smtpencryption = tls
smtpuser = a@awn.dk

[push]
default = simple

2 changes: 1 addition & 1 deletion tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
262 changes: 141 additions & 121 deletions vimrc
Original file line number Diff line number Diff line change
@@ -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 <C-A>/<C-X> 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
Expand All @@ -52,7 +118,6 @@ if has("gui_running")
endif
endif


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Visual Cues
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Expand All @@ -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 <Tab> 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
Expand All @@ -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 <F5> :call g:ClangUpdateQuickFix()<CR>
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 <F4> :ClangFormat<CR>


" 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 <C-Space> <C-X><C-I>
imap <Nul> <C-X><C-I>
" Bash like tab completion
set wildmode=longest,list,full
set wildmenu

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugins
Expand All @@ -162,41 +165,58 @@ imap <Nul> <C-X><C-I>
let g:Powerline_symbols="fancy"
let g:Powerline_theme="default"
let g:Powerline_colorscheme="default"


" View mini buffer explorer
map <silent> <F3> :call BufferList()<CR>
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 <F12> :FSHere<CR>
imap <F12> <ESC>:FSHere<CR>
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 <Esc> to exit terminal-mode:
tnoremap <Esc> <C-\><C-n>
" To use `ALT+{h,j,k,l}` to navigate windows from any mode:
tnoremap <A-h> <C-\><C-N><C-w>h
tnoremap <A-j> <C-\><C-N><C-w>j
tnoremap <A-k> <C-\><C-N><C-w>k
tnoremap <A-l> <C-\><C-N><C-w>l
inoremap <A-h> <C-\><C-N><C-w>h
inoremap <A-j> <C-\><C-N><C-w>j
inoremap <A-k> <C-\><C-N><C-w>k
inoremap <A-l> <C-\><C-N><C-w>l
nnoremap <A-h> <C-w>h
nnoremap <A-j> <C-w>j
nnoremap <A-k> <C-w>k
nnoremap <A-l> <C-w>l
nnoremap <C-p> :FuzzyOpen<CR>

0 comments on commit 79af20a

Please sign in to comment.