From 36c19a33127316bea52d46130d53035a328eb1c5 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 26 Apr 2020 08:33:18 +0200 Subject: Change colorscheme to solarized and switched to st --- .pluggins.vim | 15 ++++++++------- .vimrc | 51 +++++++++++++++++++++++++++++++++------------------ .zsh_aliases | 1 + xmonad.hs | 2 +- 4 files changed, 43 insertions(+), 26 deletions(-) diff --git a/.pluggins.vim b/.pluggins.vim index 9289f7f..d3f66ea 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -4,17 +4,18 @@ call plug#begin() Plug 'tpope/vim-eunuch' " basic unix command in vim Plug 'tomtom/tcomment_vim' " mininal commenter Plug 'itchyny/lightline.vim' " minimal status bar - Plug 'unblevable/quick-scope' " highlight first char to jump to word - - " bloat?? - Plug 'romainl/vim-cool' " disable highlight after search - Plug 'justinmk/vim-syntax-extra' " better syntax highlight Plug 'sheerun/vim-polyglot' " better syntax highlight " s19 at home Plug 'pbondoer/vim-42header' " 42 header " themes - Plug 'joshdick/onedark.vim' " onedark - Plug 'dracula/vim', {'as': 'vim'} " dracula + " Plug 'joshdick/onedark.vim' " onedark + " Plug 'dracula/vim', {'as': 'vim'} " dracula + Plug 'altercation/vim-colors-solarized' " solarized + + " intresting but not used + " Plug 'unblevable/quick-scope' " highlight first char to jump to word + " Plug 'romainl/vim-cool' " disable highlight after search + " Plug 'justinmk/vim-syntax-extra' " better syntax highlight call plug#end() diff --git a/.vimrc b/.vimrc index a8d3bf4..dc57121 100644 --- a/.vimrc +++ b/.vimrc @@ -15,7 +15,7 @@ let mapleader = ' ' " set leader key to space let maplocalleader = '-' " set file local leader key to backslash set nocompatible " not compatible with vi set number " line number -set relativenumber " line number relative to cursor +" set relativenumber " line number relative to cursor set numberwidth=1 " line numbers gutter autowidth set cursorline " highlight current line set noshowmatch " dont jump to pair bracket @@ -74,18 +74,26 @@ set nofoldenable " not folded by default """"""""""""""" " one {{{ -let g:onedark_terminal_italics=1 -colorscheme onedark +" let g:onedark_terminal_italics=1 +" colorscheme onedark " }}} " dracula {{{ -let g:dracula_bold = 1 -let g:dracula_italic = 1 -let g:dracula_colorterm = 0 +" let g:dracula_bold = 1 +" let g:dracula_italic = 1 +" let g:dracula_colorterm = 0 " colorscheme dracula " }}} +" solarized {{{ +set t_Co=16 +let g:solarized_termcolors=16 +let g:solarized_visibility='low' " visibility of invisible chars with set list +set background=dark +colorscheme solarized +" }}} " lightline {{{ let g:lightline = {} -let g:lightline.colorscheme = 'jellybeans' " lightline theme to onedark +let g:lightline.colorscheme = 'solarized' " lightline theme to solarized +" let g:lightline.colorscheme = 'jellybeans' " lightline theme to onedark " }}} @@ -144,7 +152,7 @@ nnoremap src :source $MYVIMRC " c {{{ " create c function body from prototype -nnoremap gcf A{}j +nnoremap gcf A{}j " initialise a school header file function PutHeaderBoilerPlate() @@ -156,22 +164,27 @@ function PutHeaderBoilerPlate() endfunction nnoremap gch :Stdheader:call PutHeaderBoilerPlate() -function PutCoplienForm(name) +" put semicolon at the end of line +nnoremap ; mqA;`q +" doxygen format comments +autocmd Filetype c setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/ +autocmd Filetype cpp setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/ +" }}} + +" cpp {{{ +" Put Coplien Form boilerplate class +function PutCoplienFormFunc(name) let l:default_constructor = a:name . "();\n" - let l:copy_constructor = a:name . "(" . a:name . " const& other);\n" - let l:copy_operator = "void operator=(" . a:name . " const& other);\n" + let l:copy_constructor = a:name . "(const " . a:name . "& other);\n" + let l:copy_operator = a:name . "& operator=(const " . a:name . "& other);\n" let l:destructor = "~" . a:name . "();\n" execute "normal iclass " . a:name . "\n{\npublic:\n" . l:default_constructor . l:copy_constructor . l:copy_operator . l:destructor . "\nprivate:\n};\n" execute "normal <2{" endfunction -command! PutCoplienFormFile call PutCoplienForm(split(expand('%:t'), '\.')[0]) - -" put semicolon at the end of line -nnoremap ; mqA;`q -" doxygen format comments -autocmd Filetype c setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/ -autocmd Filetype cpp setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/ +" Put Coplien Form boilerplate according to filename +command! PutCoplienFormFile call PutCoplienFormFunc(split(expand('%:t'), '\.')[0]) +command! -nargs=1 PutCoplienForm call PutCoplienFormFunc("") " }}} " quickfix window toggle {{{ @@ -205,6 +218,8 @@ autocmd BufWritePre * %s/\s\+$//e " real tab in c file for school projects autocmd BufReadPre,BufNewFile *.h,*.c set filetype=c autocmd Filetype c setlocal noexpandtab +" std::cout << ... << std::endl; shortcut +autocmd Filetype cpp nnoremap cout istd::cout << << std::endl;2F