aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-14 13:06:17 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-14 13:06:17 +0200
commit5828534933ffd5ca23c6e47b7c12a4a2637e01f0 (patch)
tree4385c66fabdaf2dd71a8f7cc2fabca49fb2896dd
parent10d80f8d2858de6da4a73073e3f68dfd269d6cff (diff)
downloaddotfiles-5828534933ffd5ca23c6e47b7c12a4a2637e01f0.tar.gz
dotfiles-5828534933ffd5ca23c6e47b7c12a4a2637e01f0.tar.bz2
dotfiles-5828534933ffd5ca23c6e47b7c12a4a2637e01f0.zip
Added vim functions to help with boilerplate in c++ files
-rw-r--r--.alacritty.yml43
-rw-r--r--.ghci2
-rw-r--r--.pluggins.vim8
-rw-r--r--.vimrc59
-rw-r--r--.zsh_aliases12
-rw-r--r--.zshrc18
-rw-r--r--redshift.conf2
7 files changed, 130 insertions, 14 deletions
diff --git a/.alacritty.yml b/.alacritty.yml
new file mode 100644
index 0000000..ddfce65
--- /dev/null
+++ b/.alacritty.yml
@@ -0,0 +1,43 @@
+#############
+# alacritty #
+#############
+
+# font
+font:
+ size: 9
+ normal:
+ family: Fira Code
+
+
+ offset:
+ x: 0
+ y: 0
+
+# colorscheme (Dracula)
+colors:
+ # Default colors
+ primary:
+ background: '#282a36'
+ foreground: '#f8f8f2'
+
+ # Normal colors
+ normal:
+ black: '#000000'
+ red: '#ff5555'
+ green: '#50fa7b'
+ yellow: '#f1fa8c'
+ blue: '#caa9fa'
+ magenta: '#ff79c6'
+ cyan: '#8be9fd'
+ white: '#bfbfbf'
+
+ # Bright colors
+ bright:
+ black: '#575b70'
+ red: '#ff6e67'
+ green: '#5af78e'
+ yellow: '#f4f99d'
+ blue: '#caa9fa'
+ magenta: '#ff92d0'
+ cyan: '#9aedfe'
+ white: '#e6e6e6'
diff --git a/.ghci b/.ghci
index ec73138..31f559e 100644
--- a/.ghci
+++ b/.ghci
@@ -1 +1 @@
-:set prompt λ>
+:set prompt "λ "
diff --git a/.pluggins.vim b/.pluggins.vim
index 2312e9a..9289f7f 100644
--- a/.pluggins.vim
+++ b/.pluggins.vim
@@ -1,6 +1,5 @@
" plugins
call plug#begin()
- Plug 'joshdick/onedark.vim' " theme
Plug 'ctrlpvim/ctrlp.vim' " Ctrl-P similar to vsc
Plug 'tpope/vim-eunuch' " basic unix command in vim
Plug 'tomtom/tcomment_vim' " mininal commenter
@@ -11,4 +10,11 @@ call plug#begin()
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
call plug#end()
diff --git a/.vimrc b/.vimrc
index 1fc69f0..a8d3bf4 100644
--- a/.vimrc
+++ b/.vimrc
@@ -20,11 +20,13 @@ set numberwidth=1 " line numbers gutter autowidth
set cursorline " highlight current line
set noshowmatch " dont jump to pair bracket
set autoread " reload files when changes happen outside vim
+set autowrite " auto write buf on certain events
set hidden " keep change in buffer when quitting window
set noswapfile " disable swap files
set scrolloff=2 " line padding when scrolling
set textwidth=89 " when line wrap occurs
set encoding=utf-8 " utf-8 encoding
+set formatoptions-=t " do not auto break line > 89 character
filetype plugin indent on " allow to add specific rules for certain type of file
" }}}
@@ -37,7 +39,7 @@ set path+=** " recursive :find
" intuitif split opening {{{
set splitbelow
set splitright
-set fcs+=vert:\ " no split separator
+set fcs+=vert:│ " split separator
" }}}
" tab {{{
@@ -64,6 +66,7 @@ set noshowmode " dont show current mode (i.e --INSERT--)
" fold {{{
set foldmethod=indent " create fold based on the text indent
+set nofoldenable " not folded by default
" }}}
"""""""""""""""
@@ -73,6 +76,14 @@ set foldmethod=indent " create fold based on the text indent
" one {{{
let g:onedark_terminal_italics=1
colorscheme onedark
+" }}}
+" dracula {{{
+let g:dracula_bold = 1
+let g:dracula_italic = 1
+let g:dracula_colorterm = 0
+" colorscheme dracula
+" }}}
+" lightline {{{
let g:lightline = {}
let g:lightline.colorscheme = 'jellybeans' " lightline theme to onedark
" }}}
@@ -87,6 +98,10 @@ nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
+" nnoremap <C-S-J> <C-W><S-J>
+" nnoremap <C-S-K> <C-W><S-K>
+" nnoremap <C-S-L> <C-W><S-L>
+" nnoremap <C-S-H> <C-W><S-H>
nnoremap <leader>s= <C-W>=
" }}}
@@ -129,7 +144,29 @@ nnoremap <leader>src :source $MYVIMRC<cr>
" c {{{
" create c function body from prototype
-nnoremap gcf A<BS><CR>{<CR><CR>}<ESC>
+nnoremap gcf A<BS><CR>{<CR><CR>}<CR><ESC>j
+
+" initialise a school header file
+function PutHeaderBoilerPlate()
+ let l:filename = join(split(toupper(expand('%:t')), '\.'), "_")
+ " echom l:filename
+ call append(12, "#ifndef " . l:filename)
+ call append(13, "# define " . l:filename)
+ call append(15, "#endif")
+endfunction
+nnoremap gch :Stdheader<CR>:call PutHeaderBoilerPlate()<CR>
+
+function PutCoplienForm(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: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 <leader>; mqA;<ESC>`q
" doxygen format comments
@@ -138,7 +175,9 @@ autocmd Filetype cpp setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/
" }}}
" quickfix window toggle {{{
-nnoremap <leader>q :call QuickfixToggle()<CR>
+nnoremap <leader>qt :call QuickfixToggle()<CR>
+nnoremap <leader>qn :cnext <CR>
+nnoremap <leader>qp :cprevious <CR>
let g:quickfix_is_open = 0
if !exists('*QuickfixToggle')
function QuickfixToggle()
@@ -153,11 +192,13 @@ if !exists('*QuickfixToggle')
endif
" }}}
+" make {{{
+nnoremap <leader>m :make all <CR>
+" }}}
+
" hook {{{
" remove trailing white space on save
autocmd BufWritePre * %s/\s\+$//e
-" initialise buf for fold toggle
-autocmd BufReadPre * :normal zMzi
" }}}
" filetype {{{
@@ -177,8 +218,16 @@ autocmd Filetype vim setlocal foldmethod=marker
set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*
" ctrlp ignore all stuff in the .gitignore
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
+let g:ctrlp_working_path_mode = 'rw'
" }}}
" quick-scope {{{
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
" }}}
+
+" man-plugin {{{
+runtime! ftplugin/man.vim
+let g:ft_man_open_mode = 'vert' " open in a vertical split
+let g:ft_man_no_sect_fallback = 2 " if page specified fallback to page 2 (syscall pages)
+" autocmd Filetype man unmap <buffer> q: hmmmm??
+" }}}
diff --git a/.zsh_aliases b/.zsh_aliases
index 72b727f..b40891a 100644
--- a/.zsh_aliases
+++ b/.zsh_aliases
@@ -32,6 +32,10 @@ alias treeI="tree -I '__pycache__' -I '*.o' -I vendor"
alias m="man"
alias m2="man 2"
alias m3="man 3"
+alias manv="man -P 'vim -M +MANPAGER -'" # vim has man pager
+alias manv2="man 2 -P 'vim -M +MANPAGER -'"
+alias manv3="man 3 -P 'vim -M +MANPAGER -'"
+alias manv5="man 5 -P 'vim -M +MANPAGER -'"
# git
alias ga="git add"
@@ -57,7 +61,7 @@ alias gstp="git stash pop"
alias lpassp="lpass show --password --clip" # put password in clipboard
# helper to switch between dual and single monitor setup
-alias dual='xrandr --output LVDS1 --primary --left-of VGA1 --output VGA1 --auto'
+alias dual='xrandr --output LVDS1 --primary --below VGA1 --output VGA1 --auto'
alias single='xrandr --output VGA1 --off'
# edit config files
@@ -71,3 +75,9 @@ alias xmonadrc="vim $DOTFILES/xmonad.hs"
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
+
+alias norm='ruby -I/home/charles/norminette/vendor/bundle/ruby/2.7.0/gems/parseconfig-1.0.8/lib/ ~/norminette/norminette.rb'
+
+getrfc() {
+ curl "https://ietf.org/rfc/rfc$1.txt" > "$HOME/rfc/rfc$1.txt"
+}
diff --git a/.zshrc b/.zshrc
index 7512fcf..6bd7b11 100644
--- a/.zshrc
+++ b/.zshrc
@@ -52,7 +52,7 @@ function chpwd() {
# add command-not-found package suggestion
#source /etc/zsh_command_not_found
-# color in man
+# color in man (less pager)
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
@@ -60,16 +60,22 @@ export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
-
-# XDG
+export LESS_TERMCAP_mr=$(tput rev)
+export LESS_TERMCAP_mh=$(tput dim)
+export LESS_TERMCAP_ZN=$(tput ssubm)
+export LESS_TERMCAP_ZV=$(tput rsubm)
+export LESS_TERMCAP_ZO=$(tput ssupm)
+export LESS_TERMCAP_ZW=$(tput rsupm)
+
+#XDG
export XDG_CONFIG_HOME="/home/charles/.config/"
export XDG_DATA_HOME="/home/charles/.data/"
export EDITOR="vim"
export TERM="xterm-256color"
-# set tab to 4 spaces
-tabs 4
+# mail
+export MAIL='charles.cabergs@gmail.com'
# ignore filetypes in autocomplete
fignore=(o hi)
@@ -80,3 +86,5 @@ source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # prompt
export YSU_MESSAGE_POSITION="after" # you-should-use message after command output
source $HOME/.zsh/zsh-you-should-use/you-should-use.plugin.zsh # alias reminder
+# set tab to 4 spaces
+tabs 4
diff --git a/redshift.conf b/redshift.conf
index f012aba..32fff4f 100644
--- a/redshift.conf
+++ b/redshift.conf
@@ -1,5 +1,5 @@
[redshift]
-temp-day=3000
+temp-day=2800
temp-night=2600
; transition day/night