diff --git a/.config/Scripts/i3-resurrect-restore-all b/.config/Scripts/i3-resurrect-restore-all index 946b9d3..9d4eeda 100755 --- a/.config/Scripts/i3-resurrect-restore-all +++ b/.config/Scripts/i3-resurrect-restore-all @@ -12,7 +12,7 @@ IFS=$'\n\t' cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.visible == true) | .name') # extract workspace name which is defined between two underscored -workspaces=$(ls -l ~/.i3/i3-resurrect/*.json | grep -Po '.*_\K(.*)_' | sed 's/_//' | uniq) +workspaces=$(ls -l ~/.config/i3-resurrect/*.json | grep -Po '.*_\K(.*)_' | sed 's/_//' | uniq) echo "Found workspaces: $workspaces" # restore workspaces diff --git a/.config/Scripts/i3-resurrect-save-all b/.config/Scripts/i3-resurrect-save-all index 1bfa411..2dbb180 100755 --- a/.config/Scripts/i3-resurrect-save-all +++ b/.config/Scripts/i3-resurrect-save-all @@ -9,7 +9,7 @@ IFS=$'\n\t' # example suggested usage: i3-resurrect-save-all # remove old saves -rm -f ~/.i3/i3-resurrect/* +rm -f ~/.config/i3-resurrect/* # find running workspaces workspaces=$(i3-msg -t get_workspaces | jq '.[] | .name') diff --git a/.config/nvim/config/main.vim b/.config/nvim/config/main.vim new file mode 100644 index 0000000..4809022 --- /dev/null +++ b/.config/nvim/config/main.vim @@ -0,0 +1,151 @@ +"*********************************************************************************** +" __ ___ _ ____ __ __ _ +" / |/ / ___ _ (_) ___ / __/ ___ / /_ / /_ (_) ___ ___ _ ___ +" / /|_/ / / _ `/ / / / _ \ _\ \ / -_)/ __// __/ / / / _ \ / _ `/ (_-< +"/_/ /_/ \_,_/ /_/ /_//_/ /___/ \__/ \__/ \__/ /_/ /_//_/ \_, / /___/ +" /___/ +" +"*********************************************************************************** + + + +" Colorscheme +colorscheme wal + +augroup specify_filetype + autocmd! + autocmd BufRead,BufNewFile *.md set filetype=markdown + autocmd BufRead,BufNewFile *.txt set filetype=text +augroup END + + +" Longer leader key timeout +set timeout timeoutlen=1500 + +" Enable spell-checking for certain files +autocmd FileType text,markdown setlocal spell + +" Limit line length for text files +autocmd FileType text,markdown,tex setlocal textwidth=180 + +" Don't automatically collapse markdown +set conceallevel=0 + +" Don't display mode in command line (airline already shows it) +set noshowmode + +" Automatically re-read file if a change was detected outside of vim +set autoread + +" no case-sensitive search unless uppercase is present +set ignorecase +set smartcase + +" Enable mouse scroll +set mouse=a + +" Allow a new buffer to be opened without saving current +set hidden + +" Statusline Config +set statusline+=%F +set cmdheight=1 + +" Tab Settings +set expandtab +set tabstop=2 +set softtabstop=2 +set shiftwidth=2 +set smarttab +set autoindent +set smartindent +set shiftround + +" Enable syntax highlighting +syntax on + +" Print syntax highlighting. +set printoptions+=syntax:y + +" Matching braces/tags +set showmatch + +" Keep a backup file. +"set backup + +" Save undo tree. +"set undofile + +" Do not back up temporary files. +set backupskip=/tmp/*,/private/tmp/*" + +" Store backup files in one place. +set backupdir^=$HOME/.config/nvim//storage/backups// + +" Store swap files in one place. +set dir^=$HOME/.config/nvim//storage/swaps// + +" Store undo files in one place. +set undodir^=$HOME/.config/nvim/storage/undos// + +" No line wrapping +set nowrap + +" Turns on detection for fyletypes, indentation files and plugin files +filetype plugin indent on + +" Split window appears right the current one. +set splitright + +" Make sure compatible mode is disabled +set nocompatible + +" Share yank buffer with system clipboard +set clipboard=unnamedplus + +" Show next 3 lines while scrolling. +if !&scrolloff + set scrolloff=3 +endif + +" Show next 5 columns while side-scrolling. +if !&sidescrolloff + set sidescrolloff=5 +endif + +" Jump to the last known position when reopening a file. +if has("autocmd") + au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") + \| exe "normal! g'\"" | endif +endif + +" Relative line numbers +set number +augroup numbertoggle + autocmd! + autocmd BufEnter,FocusGained,InsertLeave * set relativenumber + autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber +augroup END + + +" Subscript digraphs for maths +"alphsubs ---------------------- {{{ + execute "digraphs ks " . 0x2096 + execute "digraphs as " . 0x2090 + execute "digraphs es " . 0x2091 + execute "digraphs hs " . 0x2095 + execute "digraphs is " . 0x1D62 + execute "digraphs ks " . 0x2096 + execute "digraphs ls " . 0x2097 + execute "digraphs ms " . 0x2098 + execute "digraphs ns " . 0x2099 + execute "digraphs os " . 0x2092 + execute "digraphs ps " . 0x209A + execute "digraphs rs " . 0x1D63 + execute "digraphs ss " . 0x209B + execute "digraphs ts " . 0x209C + execute "digraphs us " . 0x1D64 + execute "digraphs vs " . 0x1D65 + execute "digraphs xs " . 0x2093 +"}}} + diff --git a/.config/nvim/config/mappings.vim b/.config/nvim/config/mappings.vim new file mode 100644 index 0000000..dddc98c --- /dev/null +++ b/.config/nvim/config/mappings.vim @@ -0,0 +1,119 @@ +"################################################################################### +" __ ___ _ +" / |/ /____ _ ____ ____ (_)____ ____ _ _____ +" / /|_/ // __ `// __ \ / __ \ / // __ \ / __ `// ___/ +" / / / // /_/ // /_/ // /_/ // // / / // /_/ /(__ ) +" /_/ /_/ \__,_// .___// .___//_//_/ /_/ \__, //____/ +" /_/ /_/ /____/ +" +"################################################################################### + +"*********************************************************************************** + +" Main Vim Keybinds + +"*********************************************************************************** + + +" Set leader to space bar +let mapleader = " " +let maplocalleader = " " + +" Window Navigation +" Navigate to left window. +nnoremap h +" Navigate to down window. +nnoremap j +" Navigate to top window. +nnoremap k +" Navigate to right window. +nnoremap l +" Horizontal split then move to bottom window. +nnoremap - s +" Vertical split then move to right window. +nnoremap \| vl +" Cycle tabs with Tab and Shift+Tab +nnoremap :bnext +nnoremap :bprevious +" Kill buffer with Space+bk +nnoremap bk :bdelete + +"Faster ESC. +inoremap jk +inoremap kj + +" Indent controls +" Reselect text ater indent/unindent. +vnoremap < >gv +" Tab to indent in visual mode. +vnoremap >gv +" Shift+Tab to unindent in visual mode. +vnoremap Al :left +nnoremap Ac :center +nnoremap Ar :right +vnoremap Al :left +vnoremap Ac :center +vnoremap Ar :right + +"*********************************************************************************** + +" Plugin specific keybinds + +"*********************************************************************************** + +" Git status +nnoremap gs :Gstatus +" Git diff in split window +nnoremap gd :Gdiffsplit +" Git commit +nnoremap gc :Gcommit +" Git push +nnoremap gP :Gpush +" Git pull +nnoremap gp :Gpull +" Git move +nnoremap gm :Gmove +" Git merge +nnoremap gM :Gmerge +" browse current file on web +nnoremap gb :Gbrowse +" browse current line on web +nnoremap gbl :CocCommand git.browserOpen +" View chunk information in preview window. +nnoremap gh :CocCommand git.chunkInfo +" View commit information in preview window. +nnoremap gsc :CocCommand git.showCommit +" Toggle git gutter sign columns +nnoremap gg :CocCommand git.toggleGutters + + +" NERD Commenter +" Toggle comments in visual or normal mode +nnoremap n :call NERDComment(0,"toggle") +vnoremap n :call NERDComment(1,"toggle") +" Toggle a sexy comment +nnoremap ns :call NERDComment(0,"sexy") +vnoremap ns :call NERDComment(1,"sexy") +" append a comment +nnoremap na :call NERDComment(0,"append") +vnoremap na :call NERDComment(1,"append") +" uncomment section +nnoremap nu :call NERDComment(0,"uncomment") +vnoremap nu :call NERDComment(1,"uncomment") +" invert comments +nnoremap ni :call NERDComment(0,"invert") +vnoremap ni :call NERDComment(1,"invert") +" comment section +nnoremap nc :call NERDComment(0,"comment") +vnoremap nc :call NERDComment(1,"comment") +" + +" Fuzzy Finding +" fuzzy find files +nnoremap ff :Files +" fuzzy find tags +nnoremap ft :Vista finder ctags diff --git a/.config/nvim/config/plugin-settings.vim b/.config/nvim/config/plugin-settings.vim new file mode 100644 index 0000000..463c330 --- /dev/null +++ b/.config/nvim/config/plugin-settings.vim @@ -0,0 +1,138 @@ +"***************************************************************************************** +" ___ __ _ ____ __ __ _ +" / _ \ / / __ __ ___ _ (_) ___ / __/ ___ / /_ / /_ (_) ___ ___ _ ___ +" / ___/ / / / // / / _ `/ / / / _ \ _\ \ / -_)/ __// __/ / / / _ \ / _ `/ (_-< +"/_/ /_/ \_,_/ \_, / /_/ /_//_/ /___/ \__/ \__/ \__/ /_/ /_//_/ \_, / /___/ +" /___/ /___/ +" +"***************************************************************************************** + +""""""""""" +" Tmuxline" +" """"""""" +let g:tmuxline_preset = { + \'a' : '#S', + \'b' : '#W', + \'c' : ['#(~/.config/Scripts/showip)'], + \'win' : ['#I', '#W'], + \'cwin' : ['#I', '#W', '#F'], + \'y' : ['%R', '%a', '%Y'], + \'z' : '#H'} + +""""""""""" +" Goyo " +""""""""""" +nmap :Goyo + + +""""""""""" +" Vista " +""""""""""" +nmap :Vista!! +let g:vista_executive_for = { + \ 'c': 'coc', + \ } +nnoremap vf :Vista finder coc +let g:vista_icon_indent = ["╰─▸ ", "├─▸ "] +let g:vista#renderer#enable_icon = 1 +let g:vista_sidebar_width = 50 + +"""""""""""" +"NerdTree " +"""""""""""" +" if nerdtree is only window, kill nerdtree so buffer can die +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | :bdelete | endif +map :NERDTreeToggle +let nerdtreequitonopen = 0 +let NERDTreeShowHidden=1 +let nerdchristmastree=1 +let g:NERDTreeMinimalUI = 1 +let g:nerdtreewinsize = 25 +let g:NERDTreeDirArrowExpandable = '▷' +let g:NERDTreeDirArrowCollapsible = '▼' +let NERDTreeAutoCenter=1 +let g:NERDTreeIndicatorMapCustom = { + \ "modified" : "✹", + \ "staged" : "✚", + \ "untracked" : "✭", + \ "renamed" : "➜", + \ "unmerged" : "═", + \ "deleted" : "✖", + \ "dirty" : "✗", + \ "clean" : "✔︎", + \ 'ignored' : '☒', + \ "unknown" : "?" + \ } + + +"""""""""""" +"Airline " +"""""""""""" +"main settings +let g:airline_theme='wpgtk' +let g:airline_powerline_fonts = 1 +let g:airline_symbols = {} +let g:airline_skip_empty_sections = 1 +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols_branch = '' +let g:airline_powerline_fonts = 1 +let g:airline_symbols.crypt = '' +let g:airline_symbols.linenr = '☰' +let g:airline_symbols.linenr = '␊' +let g:airline_symbols.linenr = '␤' +let g:airline_symbols.linenr = '¶' +let g:airline_symbols.maxlinenr = '' +let g:airline_symbols.paste = 'ρ' +let g:airline_symbols.paste = 'Þ' +let g:airline_symbols.paste = '∥' +let g:airline_symbols.spell = 'Ꞩ' +let g:airline_symbols.notexists = 'Ɇ' +let g:airline_symbols.whitespace = 'Ξ' +let g:airline_symbols.modified = ' ' +let g:airline_section_error = '%{airline#util#wrap(airline#extensions#coc#get_error(),0)}' +let g:airline_section_warning = '%{airline#util#wrap(airline#extensions#coc#get_warning(),0)}' +"extensions +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#ale#enabled = 1 +let g:airline#extensions#coc#enabled = 1 +let g:airline#extensions#unicode#enabled = 1 +let g:airline#extensions#branch#enabled = 1 +let g:airline#extensions#vista#enabled = 1 +let g:airline#extensions#hunks#enabled = 1 +"extension settings +let airline#extensions#coc#stl_format_err = '%E{[%e(#%fe)]}' +let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}' +let airline#extensions#coc#warning_symbol = ':' +let airline#extensions#coc#error_symbol = ':' +let g:airline#extensions#hunks#hunk_symbols = [':', ':', ':'] +let g:airline#extensions#branch#format = 2 + + +""""""""""""" +"Devicons " +""""""""""""" +let g:webdevicons_enable = 1 +let g:webdevicons_enable_unite = 1 +let g:webdevicons_enable_denite = 1 +let g:webdevicons_enable_nerdtree = 1 +let g:webdevicons_enable_airline_tabline = 1 +let g:webdevicons_enable_vimfiler = 1 +let g:WebDevIconsUnicodeDecorateFileNodes = 1 +let g:WebDevIconsUnicodeDecorateFolderNodes = 1 +let g:WebDevIconsUnicodeGlyphDoubleWidth = 1 +let g:webdevicons_enable_airline_statusline = 1 +let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1 +let g:WebDevIconsUnicodeGlyphDoubleWidth = 1 +let g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol = '' +let g:DevIconsDefaultFolderOpenSymbol = '' + +""""""""""""""""" +"Comfy-Scroll " +""""""""""""""""" +noremap :call comfortable_motion#flick(40) +noremap :call comfortable_motion#flick(-40) +let g:comfortable_motion_friction = 50.0 +let g:comfortable_motion_air_drag = 1.0 diff --git a/.config/nvim/config/plugins.vim b/.config/nvim/config/plugins.vim new file mode 100644 index 0000000..05aab10 --- /dev/null +++ b/.config/nvim/config/plugins.vim @@ -0,0 +1,89 @@ + +"##################################################################################################### +" ____ __ _ +" / __ \ / / __ __ ____ _ (_) ____ _____ +" / /_/ / / / / / / / / __ `/ / / / __ \ / ___/ +" / ____/ / / / /_/ / / /_/ / / / / / / / (__ ) +" /_/ /_/ \__,_/ \__, / /_/ /_/ /_/ /____/ +" /____/ +"###################################################################################################### + +" Install vim-plugged if not already installed +if empty(glob('~/.local/share/nvim/site/autoload/plug.vim')) + silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif +call plug#begin('~/.vim/plugged') + +" Git wrapper +Plug 'tpope/vim-fugitive' +Plug 'airblade/vim-gitgutter' +Plug 'tpope/vim-rhubarb' + +" Nerd Commenter +Plug 'scrooloose/nerdcommenter' + +" Autosaving +Plug '907th/vim-auto-save' + +" Vim Surround +Plug 'tpope/vim-surround' + +" Auto pairs +Plug 'jiangmiao/auto-pairs' + +" Multiple Cursors +Plug 'terryma/vim-multiple-cursors' + +" Fuzzy finding +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --no-bash' } +Plug 'junegunn/fzf.vim' + +" i3 syntax +Plug 'PotatoesMaster/i3-vim-syntax' + +" Tmuxline +Plug 'edkolev/tmuxline.vim' + +" Custom start page +Plug 'mhinz/vim-startify' + +" Status bar +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' + +" Tabular auto-align +Plug 'godlygeek/tabular' + +" Comfy scroll +Plug 'yuttie/comfortable-motion.vim' + +" Add DevIcons +Plug 'ryanoasis/vim-devicons' + +" Tagbar +Plug 'liuchengxu/vista.vim' + +" NERDTree +Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } +Plug 'Xuyuanp/nerdtree-git-plugin' +Plug 'tiagofumo/vim-nerdtree-syntax-highlight' + +" goyo distraction free mode +Plug 'junegunn/goyo.vim' + +" Wal theme +Plug 'dylanaraps/wal.vim' +Plug 'deviantfero/wpgtk.vim' + +" Colorschemes + Plug 'chase/focuspoint-vim' + Plug 'liuchengxu/space-vim-theme' + Plug 'kadekillary/Turtles' + Plug 'arcticicestudio/nord-vim' + Plug 'whatyouhide/vim-gotham' + Plug 'itchyny/landscape.vim' + Plug 'nanotech/jellybeans.vim' + +call plug#end() diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ed98a00..8b91abd 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,64 +1,8 @@ -set nocompatible " Disable compatibility to old-time vi -set showmatch " Show matching brackets. -set ignorecase " Do case insensitive matching -set mouse=v " middle-click paste with mouse -set hlsearch " highlight search results -set tabstop=4 " number of columns occupied by a tab character -set softtabstop=4 " see multiple spaces as tabstops so does the right thing -set expandtab " converts tabs to white space -set shiftwidth=4 " width for autoindents -set autoindent " indent a new line the same amount as the line just typed -set number " add line numbers -set wildmode=longest,list " get bash-like tab completions -set autoread " refresh file -if (has("termguicolors")) - set termguicolors -endif -syntax on - -" allows auto-indenting depending on file type -filetype plugin indent on - -call plug#begin('~/.local/share/nvim/site/autoload') -Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } -Plug 'dylanaraps/wal' -Plug 'PotatoesMaster/i3-vim-syntax' -Plug 'Xuyuanp/nerdtree-git-plugin' -Plug 'mhinz/vim-startify' -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-sensible' -Plug 'tpope/vim-obsession' -Plug 'junegunn/gv.vim' -Plug 'junegunn/goyo.vim' -Plug 'edkolev/tmuxline.vim' -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'chrisbra/colorizer' -Plug 'chase/focuspoint-vim' -Plug 'liuchengxu/space-vim-theme' -Plug 'kadekillary/Turtles' -Plug 'arcticicestudio/nord-vim' -Plug 'whatyouhide/vim-gotham' -Plug 'deviantfero/wpgtk.vim' -Plug 'itchyny/landscape.vim' -call plug#end() - -map :NERDTreeToggle - -colorscheme wal - -let g:airline_powerline_fonts = 1 -let g:airline_theme='nord' -let g:tmuxline_preset = { - \'a' : '#S', - \'b' : '#W', - \'c' : ['#(~/.config/Scripts/showip)'], - \'win' : ['#I', '#W'], - \'cwin' : ['#I', '#W', '#F'], - \'y' : ['%R', '%a', '%Y'], - \'z' : '#H'} - -" Run xrdb whenever Xdefaults or Xresources are updated. -autocmd BufWritePost *Xresources,*Xdefaults !xrdb % - +" This script contains general neovim settings +source $HOME/.config/nvim/config/main.vim +" This script contains a list of Vim-Plugged plugins +source $HOME/.config/nvim/config/plugins.vim +" This script contains plugin specific settings +source $HOME/.config/nvim/config/plugin-settings.vim +" This script contains mappings +source $HOME/.config/nvim/config/mappings.vim