diff --git a/.gitmodules b/.gitmodules index 9636a75..21f5d1a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,6 +40,6 @@ [submodule "vim/bundle/yaifa"] path = vim/bundle/yaifa url = https://github.com/vim-scripts/yaifa.vim.git -[submodule "vim/bundle/vim-colors-solarized"] - path = vim/bundle/vim-colors-solarized - url = https://github.com/altercation/vim-colors-solarized.git +[submodule "vim/bundle/nord"] + path = vim/bundle/nord + url = https://github.com/nordtheme/vim.git diff --git a/ctags b/ctags.d/base.ctags similarity index 63% rename from ctags rename to ctags.d/base.ctags index c40a705..32602fc 100644 --- a/ctags +++ b/ctags.d/base.ctags @@ -1,4 +1,5 @@ --c++-kinds=+p --fields=+iaS ---extra=+q +--extras=+q --exclude=build +--exclude=.git diff --git a/ctags.d/trenton.ctags b/ctags.d/trenton.ctags new file mode 100644 index 0000000..8044cef --- /dev/null +++ b/ctags.d/trenton.ctags @@ -0,0 +1 @@ +--exclude=mock diff --git a/dircolors b/dircolors index c318c4f..14441e0 100644 --- a/dircolors +++ b/dircolors @@ -131,24 +131,24 @@ DIR 36 LINK 35 # pipe, socket, block device, character device (blue bg) -FIFO 34 -SOCK 34 -DOOR 34 # Solaris 2.5 and later -BLK 34 -CHR 34 +FIFO 37 +SOCK 37 +DOOR 37 # Solaris 2.5 and later +BLK 37 +CHR 37 # }}} # File attributes {{{ # Orphaned symlinks (blinking white on red) # Blink may or may not work (works on iTerm dark or light, and Putty dark) -ORPHAN 05;37;45 +ORPHAN 37 # ... and the files that orphaned symlinks point to (blinking white on red) -MISSING 05;37;45 +MISSING 37 # dir that is sticky and other-writable (+t,o+w) -STICKY_OTHER_WRITABLE 36 +STICKY_OTHER_WRITABLE 37 # dir that is other-writable (o+w) and not sticky -OTHER_WRITABLE 36 +OTHER_WRITABLE 37 # files with execute permission EXEC 01;31 # Unix diff --git a/gentags b/gentags index dd62b9f..c127469 100755 --- a/gentags +++ b/gentags @@ -1,5 +1,6 @@ #!/bin/bash +LANGUAGE=${1:-CPP} CSCOPE_DIR="$PWD/cscope" if [ $# -lt 1 ]; then @@ -12,37 +13,29 @@ if [ ! -d "$CSCOPE_DIR" ]; then mkdir "$CSCOPE_DIR" fi -echo "Finding files ..." - -case $LANG in - "C") - find "$PWD" -type d \( -name regs -o -name reg \) -prune \ - -o -name '*.[ch]' \ - -o -name '*.cpp' \ - -o -name '*.cc' \ - -o -name '*.hpp' \ - > "$CSCOPE_DIR/cscope.files" - ;; - "PYTHON") - find "$PWD" -type f \ - -name "*.py" \ - > "$CSCOPE_DIR/cscope.files" - ;; - "JAVA") - find "$PWD" -type f \ - -name "*.java" \ - > "$CSCOPE_DIR/cscope.files" - ;; - "JAVASCRIPT") - find "$PWD" -type f \ - -name "*.js" \ - > "$CSCOPE_DIR/cscope.files" - ;; - *) - echo "Valid choices are C, PYTHON, JAVA, and JAVASCRIPT" - exit 1 +case ${LANGUAGE} in + CPP) ftypes=('*.c' '*.h' '*.cpp' '*.hpp' '*.cc') ;; + PYTHON) ftypes=('*.py') ;; + JAVA) ftypes=('*.java') ;; + JAVASCRIPT) ftypes=('*.js') ;; + *) + echo "Usage: ${0} [CPP|PYTHON|JAVA|JAVASCRIPT]" + exit 1 + ;; esac +echo "Finding files ..." +echo -n '' > "$CSCOPE_DIR/cscope.files" +for ftype in ${ftypes[@]}; do + find "$PWD" \ + -type f -name "${ftype}" \ + -not -path "*/mock/*" \ + -not -path "*.git/*" \ + -not -path "*/regs/*" \ + -not -path "*/Regs/*" \ + -not -path "*/reg/*" >> "$CSCOPE_DIR/cscope.files" +done + echo "Adding files to cscope db: $PWD/cscope.db ..." cscope -b -i "$CSCOPE_DIR/cscope.files" diff --git a/setup.sh b/setup.sh index 573069a..cba456d 100755 --- a/setup.sh +++ b/setup.sh @@ -18,7 +18,7 @@ git submodule init git submodule update --recursive echo "Copying configs" -config_copy_list=(ctags dircolors gitconfig inputrc tmux.conf vim vimrc Xdefaults) +config_copy_list=(ctags.d dircolors gitconfig inputrc tmux.conf vim vimrc Xdefaults) for config in ${config_copy_list[@]}; do cp -fr "$config" $HOME/."$config" done diff --git a/tmux.conf b/tmux.conf index ab7d705..6c76359 100644 --- a/tmux.conf +++ b/tmux.conf @@ -52,7 +52,7 @@ set -g status-position bottom set -g status-justify left set -g status-style 'bg=colour8 fg=colour7' set -g status-left '' -set -g status-right '#[fg=colour7,bg=colour237] LOCAL %H:%M:%S ' +set -g status-right '#[fg=colour7,bg=colour237] LOCAL %H:%M ' set -g status-right-length 50 set -g status-left-length 20 diff --git a/update_compile_commands b/update_compile_commands new file mode 100755 index 0000000..f2c4228 --- /dev/null +++ b/update_compile_commands @@ -0,0 +1,26 @@ +#!/bin/bash + +BASE_PATH="/home/anaber/prj/trenton" +DB_NAME="compile_commands.json" + +function do_update { + DB_SRC="$1" + ln -sf "${DB_SRC}" "${BASE_PATH}"/"${DB_NAME}" +} + +# Get a list of valid compile command databases in the repo +mapfile -t DB_LIST < <( find "${BASE_PATH}" -mindepth 2 -type f -name "${DB_NAME}" ) +idx=0 +for DB_ELEM in ${DB_LIST[@]}; do + echo "${idx}: ${DB_ELEM}" + idx=$((idx+1)) +done + +# Parse and validate the user selection +read -p "Select an option to update: " SELECTION +NUM_ELEM=${#DB_LIST[@]} +MAX_ELEM=$((NUM_ELEM-1)) +case "${SELECTION}" in + ''|*[!0-${MAX_ELEM}]*) echo "Operation cancelled" ;; + *) do_update "${DB_LIST[${SELECTION}]}" ;; +esac diff --git a/vim/bundle/nord b/vim/bundle/nord new file mode 160000 index 0000000..f13f5df --- /dev/null +++ b/vim/bundle/nord @@ -0,0 +1 @@ +Subproject commit f13f5dfbb784deddbc1d8195f34dfd9ec73e2295 diff --git a/vimrc b/vimrc index f7a8cbc..5f634f3 100644 --- a/vimrc +++ b/vimrc @@ -20,8 +20,8 @@ nnoremap :nohlsearch:echo syntax on filetype plugin indent on set background=dark -colorscheme solarized -"set switchbuf+=uselast " Use last window when making selection from quickfix window +colorscheme nord +set switchbuf+=uselast " Use last window when making selection from quickfix window set redrawtime=5000 " Increase maximum redraw time to use syntax highlighting for large files :set colorcolumn=80 " Add a vertical line at column 80 @@ -32,6 +32,9 @@ nnoremap tn :tabnew map :tab split:exec("tag ".expand("")) map :vsp :exec("tag ".expand("")) +hi ColorColumn guibg=#3b4252 ctermbg=black +let &colorcolumn="80,120,160" + " Load all plugins now. " Plugins need to be added to runtimepath before helptags can be generated. " packloadall @@ -72,6 +75,7 @@ let g:rainbow_ctermfgs = ['lightblue', 'lightgreen', 'yellow', 'red', 'magenta'] """" Gitgutter " CTRL-g to toggle GitGutter display nnoremap :GitGutterToggle +highlight SignColumn guibg=#002b36 ctermbg=8 " Default to off :au VimEnter * :GitGutterDisable @@ -84,10 +88,12 @@ nnoremap gdl :diffget //3 autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType yml setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType puml setlocal ts=4 sts=4 sw=4 expandtab + +"""" IndentLine let g:indentLine_char = '┆' let g:indentLine_color_term = 237 -autocmd Filetype json let g:indentLine_setConceal = 0 +let g:indentLine_conceallevel = 0 """" syntax highlighting editor settigs autocmd BufRead,BufNewFile *.cppcheck set filetype=xml autocmd BufRead,BufNewFile Jenkinsfile* set filetype=groovy