diff --git a/.gitignore b/.gitignore index 5b47485..5db45bd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dotfiles/.config/tmux/serious library/ +tags diff --git a/dotfiles/.config/fish/functions/fzf_key_bindings.fish b/dotfiles/.config/fish/functions/fzf_key_bindings.fish index b57510a..9b2065e 120000 --- a/dotfiles/.config/fish/functions/fzf_key_bindings.fish +++ b/dotfiles/.config/fish/functions/fzf_key_bindings.fish @@ -1 +1 @@ -/home/ygg/.config/fish/fisher/fish-fzf/fzf_key_bindings.fish \ No newline at end of file +/home/ygg/.fzf/shell/key-bindings.fish \ No newline at end of file diff --git a/dotfiles/.config/nvim/autocommands.vim b/dotfiles/.config/nvim/autocommands.vim new file mode 100644 index 0000000..9e79109 --- /dev/null +++ b/dotfiles/.config/nvim/autocommands.vim @@ -0,0 +1,64 @@ +" Set tabs for certain file types +" for html and css js and vue +autocmd FileType html setlocal ts=2 sw=2 expandtab +autocmd FileType css setlocal ts=2 sw=2 expandtab +autocmd FileType scss setlocal ts=2 sw=2 expandtab +autocmd FileType javascript setlocal ts=2 sw=2 expandtab +autocmd FileType json setlocal ts=4 sw=4 expandtab +autocmd FileType vue setlocal ts=2 sw=2 expandtab +" Set expand width to 2 for C/C++ +autocmd FileType cpp setlocal ts=2 sw=2 expandtab +autocmd FileType c setlocal ts=2 sw=2 expandtab +" Set expand width to 2 for Shell scripts and perl +autocmd FileType sh setlocal ts=2 sw=2 expandtab +autocmd FileType zsh setlocal ts=2 sw=2 expandtab +autocmd FileType bash setlocal ts=2 sw=2 expandtab +autocmd FileType perl setlocal ts=2 sw=2 expandtab +" Set expand width to 2 for markdown +autocmd FileType md setlocal ts=2 sw=2 expandtab +autocmd FileType markdown setlocal ts=2 sw=2 expandtab + + +" Run xrdb whenever Xdefaults or Xresources are updated. +autocmd BufWritePost *Xresources,*Xdefaults !xrdb % + +" Recompile suckless programs. only for files that are config.h +autocmd BufWritePost config.h,config.def.h !sudo make install; make clean + +" Comile any latex document into pdf form +autocmd BufWritePost answers.tex !pdflatex answers.tex + +" Compile VIU markdown notes to pdf +autocmd BufWritePost notes.md !pandoc -s -o notes.pdf notes.md + +" clear empty spaces at the end of lines on save of python files +"autocmd BufWritePre *.py :%s/\s\+$//e + + +" Ability to add python breakpoints +" (I use ipdb, but you can change it to whatever tool you use for debugging) +au FileType python map b Oimport ipdb; ipdb.set_trace() + + + +" Use auocmd to force lightline update. +autocmd User CocStatusChange,CocDiagnosticChange call lightline#update() + + +" +" Neomake ------------------------------ +" Run linter on write +autocmd! BufWritePost * Neomake + +" Check code as python3 by default +let g:neomake_python_python_maker = neomake#makers#ft#python#python() +let g:neomake_python_flake8_maker = neomake#makers#ft#python#flake8() +let g:neomake_python_python_maker.exe = 'python3 -m py_compile' +let g:neomake_python_flake8_maker.exe = 'python3 -m flake8' + +" Disable error messages inside the buffer, next to the problematic line +let g:neomake_virtualtext_current_error = 1 + + + + diff --git a/dotfiles/.config/nvim/custom.vim b/dotfiles/.config/nvim/custom.vim deleted file mode 120000 index 15245db..0000000 --- a/dotfiles/.config/nvim/custom.vim +++ /dev/null @@ -1 +0,0 @@ -library/MattDev_NvimConfig⛺/custom.vim \ No newline at end of file diff --git a/dotfiles/.config/nvim/keys.vim b/dotfiles/.config/nvim/keys.vim new file mode 100644 index 0000000..8fbb0d4 --- /dev/null +++ b/dotfiles/.config/nvim/keys.vim @@ -0,0 +1,41 @@ + +"------------------------------------------------------------------------------ +" Inherited from MattCoding4Days +" remap default leader key to comma +let mapleader = "," +nnoremap r :source $MYVIMRC +nnoremap e :e $MYVIMRC +nnoremap w :w +nnoremap i :w:source $MYVIMRC:PlugInstall + + +" Change Ctrl N mapping to Ctrl Space " +inoremap + + +" " Copy to clipboard +vnoremap y "+y +nnoremap Y "+yg_ +nnoremap y "+y +nnoremap yy "+yy + +" " Paste from clipboard +nnoremap p "+p +nnoremap P "+P +vnoremap p "+p +vnoremap P "+P + + +" tab navigation mappings +map tt :tabnew +map :tabn +imap :tabn +map :tabp +imap :tabp + +" clear search results +nnoremap // :noh + + + + diff --git a/dotfiles/.config/nvim/plugconfig/airblade/vim-rooter.vim b/dotfiles/.config/nvim/plugconfig/airblade/vim-rooter.vim new file mode 100644 index 0000000..7aa1279 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/airblade/vim-rooter.vim @@ -0,0 +1 @@ +Plug 'airblade/vim-rooter' diff --git a/dotfiles/.config/nvim/plugconfig/arielrossanigo/dir-configs-override.vim.vim b/dotfiles/.config/nvim/plugconfig/arielrossanigo/dir-configs-override.vim.vim new file mode 100644 index 0000000..56892d7 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/arielrossanigo/dir-configs-override.vim.vim @@ -0,0 +1,3 @@ + +" Override configs by directory +Plug 'arielrossanigo/dir-configs-override.vim' diff --git a/dotfiles/.config/nvim/plugconfig/junegunn/fzf.vim b/dotfiles/.config/nvim/plugconfig/junegunn/fzf.vim new file mode 100644 index 0000000..0e30482 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/junegunn/fzf.vim @@ -0,0 +1,53 @@ +" Fzf ------------------------------ +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +" The amazing junegunn fzf in vim. + +" Fzf.vim ------------------------------ +Plug 'junegunn/fzf.vim' + +"COMMANDS *fzf-vim-commands* +"============================================================================== + + "*:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:Lines* *:BLines* *:Tags* *:BTags* *:Marks* + "*:Windows* *:Locate* *:History* *:Snippets* *:Commits* *:BCommits* *:Commands* *:Maps* + "*:Helptags* *:Filetypes* + + "------------------+----------------------------------------------------------------------- + "Command | List ~ + "------------------+----------------------------------------------------------------------- + "`:Files [PATH]` | Files (runs `$FZF_DEFAULT_COMMAND` if defined) + "`:GFiles [OPTS]` | Git files ( `git ls-files` ) + "`:GFiles?` | Git files ( `git status` ) + "`:Buffers` | Open buffers + "`:Colors` | Color schemes + "`:Ag [PATTERN]` | {ag}{6} search result ( `ALT-A` to select all, `ALT-D` to deselect all) + "`:Rg [PATTERN]` | {rg}{7} search result ( `ALT-A` to select all, `ALT-D` to deselect all) + "`:Lines [QUERY]` | Lines in loaded buffers + "`:BLines [QUERY]` | Lines in the current buffer + "`:Tags [QUERY]` | Tags in the project ( `ctags -R` ) + "`:BTags [QUERY]` | Tags in the current buffer + "`:Marks` | Marks + "`:Windows` | Windows + "`:Locate PATTERN` | `locate` command output + "`:History` | `v:oldfiles` and open buffers + "`:History:` | Command history + "`:History/` | Search history + "`:Snippets` | Snippets ({UltiSnips}{8}) + "`:Commits` | Git commits (requires {fugitive.vim}{9}) + "`:BCommits` | Git commits for the current buffer + "`:Commands` | Commands + "`:Maps` | Normal mode mappings + "`:Helptags` | Help tags [1] + "`:Filetypes` | File types + "------------------+----------------------------------------------------------------------- +nnoremap :Commandsfzf# +nnoremap :History +nnoremap :History: +nnoremap :History/ +nnoremap :Files +nnoremap :Colors +nnoremap :Windows +nnoremap :Commands +nnoremap :Helptags +nnoremap :Maps +nnoremap :Buffers diff --git a/dotfiles/.config/nvim/plugconfig/junegunn/node_modules/.yarn-integrity b/dotfiles/.config/nvim/plugconfig/junegunn/node_modules/.yarn-integrity new file mode 100644 index 0000000..e14c4cc --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/junegunn/node_modules/.yarn-integrity @@ -0,0 +1,10 @@ +{ + "systemParams": "linux-x64-64", + "modulesFolders": [], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [], + "lockfileEntries": {}, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/dotfiles/.config/nvim/plugconfig/junegunn/vim-emoji.vim b/dotfiles/.config/nvim/plugconfig/junegunn/vim-emoji.vim new file mode 100644 index 0000000..d4cd89c --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/junegunn/vim-emoji.vim @@ -0,0 +1,10 @@ +Plug 'junegunn/vim-emoji' + +" Emojis as Git Gutter Symbols +"let g:gitgutter_sign_added = emoji#for('small_blue_diamond') +"let g:gitgutter_sign_modified = emoji#for('small_orange_diamond') +"let g:gitgutter_sign_removed = emoji#for('small_red_triangle') +"let g:gitgutter_sign_modified_removed = emoji#for('collision') + +" Emoji Completion +set completefunc=emoji#complete diff --git a/dotfiles/.config/nvim/plugconfig/junegunn/yarn.lock b/dotfiles/.config/nvim/plugconfig/junegunn/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/junegunn/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/dotfiles/.config/nvim/plugconfig/liuchengxu/vim-which-key.vim b/dotfiles/.config/nvim/plugconfig/liuchengxu/vim-which-key.vim new file mode 100644 index 0000000..077a3f9 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/liuchengxu/vim-which-key.vim @@ -0,0 +1,5 @@ +Plug 'liuchengxu/vim-which-key' +nnoremap :WhichKey ',' +"autocmd! User vim-which-key call which_key#register(',', 'g:which_key_map') + + diff --git a/dotfiles/.config/nvim/plugconfig/luochen1990/rainbow.vim b/dotfiles/.config/nvim/plugconfig/luochen1990/rainbow.vim new file mode 100644 index 0000000..5a1aa9d --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/luochen1990/rainbow.vim @@ -0,0 +1,7 @@ +Plug 'luochen1990/rainbow' +" rainbow brackets + +"set to 0 if you want to enable it later via :RainbowToggle +let g:rainbow_active = 0 + + diff --git a/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim b/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim new file mode 100644 index 0000000..9421602 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim @@ -0,0 +1,173 @@ +" Conquer of Completion +Plug 'neoclide/coc.nvim', {'branch': 'release'} + +" Enable the Vue Language server +let g:LanguageClient_serverCommands = { + \ 'vue': ['vls'] + \ } + +" if hidden is not set, TextEdit might fail. +set hidden + +" Some servers have issues with backup files, see #649 +set nobackup +set nowritebackup + +" Better display for messages +set cmdheight=2 + +" You will have bad experience for diagnostic messages when it's default 4000. +set updatetime=300 + +" don't give |ins-completion-menu| messages. +set shortmess+=c + +" always show signcolumns +set signcolumn=yes + +" Use tab for trigger completion with characters ahead and navigate. +" Use command ':verbose imap ' to make sure tab is not mapped by other plugin. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" Use to trigger completion. +inoremap coc#refresh() + +" Use to confirm completion, `u` means break undo chain at current position. +" Coc only does snippet and additional edit on confirm. +inoremap pumvisible() ? "\" : "\u\" +" Or use `complete_info` if your vim support it, like: +" inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" + +" Use `[g` and `]g` to navigate diagnostics +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) + +" Remap keys for gotos +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" Use K to show documentation in preview window +"nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif +endfunction + +" Highlight symbol under cursor on CursorHold +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Remap for rename current word +nmap rn (coc-rename) + +" Remap for format selected region +"xmap fr (coc-format-selected) +"nmap fr (coc-format-selected) + +augroup mygroup + autocmd! + " Setup formatexpr specified filetype(s). + autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') + " Update signature help on jump placeholder + autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') +augroup end + +" Remap for do codeAction of selected region, ex: `aap` for current paragraph +xmap a (coc-codeaction-selected) +nmap a (coc-codeaction-selected) + +" Remap for do codeAction of current line +nmap ac (coc-codeaction) +" Fix autofix problem of current line +nmap qf (coc-fix-current) + +" Create mappings for function text object, requires document symbols feature of languageserver. +xmap if (coc-funcobj-i) +xmap af (coc-funcobj-a) +omap if (coc-funcobj-i) +omap af (coc-funcobj-a) + +" Use for select selections ranges, needs server support, like: coc-tsserver, coc-python +nmap (coc-range-select) +xmap (coc-range-select) + +" Use `:Format` to format current buffer +command! -nargs=0 Format :call CocAction('format') + +" Use `:Fold` to fold current buffer +command! -nargs=? Fold :call CocAction('fold', ) + +" use `:OR` for organize import of current buffer +command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') + +" Add status line support, for integration with other plugin, checkout `:h coc-status` +set statusline^=%{StatusDiagnostic()} + +" +++++++++++++++++++++++++ Conquer of Completion +++++++++++++++++++++++++ +" Auto command for python projects +autocmd FileType python let b:coc_root_patterns = ['.git', '.env'] + +" Auto command for correct comment highlighting in Json files + autocmd FileType json syntax match Comment +\/\/.\+$+ +" status line function +function! StatusDiagnostic() abort + let info = get(b:, 'coc_diagnostic_info', {}) + if empty(info) | return '' | endif + let msgs = [] + if get(info, 'error', 0) + call add(msgs, 'E' . info['error']) + endif + if get(info, 'warning', 0) + call add(msgs, 'W' . info['warning']) + endif + return join(msgs, ' ') . ' ' . get(g:, 'coc_status', '') +endfunction + +" Disable node version warning +let g:coc_disable_startup_warning = 1 + +" Vim script coc extension +let g:markdown_fenced_languages = [ + \ 'vim', + \ 'help' + \] + +" Fancy markdown syntax +let g:markdown_fenced_languages = ['css', 'js=javascript'] + + + +" Using CocList +" Show all diagnostics +nnoremap a :CocList diagnostics +" Manage extensions +nnoremap e :CocList extensions +" Show commands +nnoremap c :CocList commands +" Find symbol of current document +nnoremap o :CocList outline +" Search workspace symbols +nnoremap s :CocList -I symbols +" Do default action for next item. +nnoremap j :CocNext +" Do default action for previous item. +nnoremap k :CocPrev +" Resume latest coc list +nnoremap p :CocListResume + + + diff --git a/dotfiles/.config/nvim/plugconfig/pechorin/any-jump.vim b/dotfiles/.config/nvim/plugconfig/pechorin/any-jump.vim new file mode 100644 index 0000000..2b9d10e --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/pechorin/any-jump.vim @@ -0,0 +1,98 @@ +Plug 'pechorin/any-jump.vim' + +" Normal mode: Jump to definition under cursore +"nnoremap j :AnyJump + +" Visual mode: jump to selected text in visual mode +"xnoremap j :AnyJumpVisual + +" Normal mode: open previous opened file (after jump) +"nnoremap ab :AnyJumpBack + +" Normal mode: open last closed search window again +"nnoremap al :AnyJumpLastResults + +let g:any_jump_disable_default_keybindings = 1 + +" Show line numbers in search rusults +let g:any_jump_list_numbers = 0 + +" Auto search references +let g:any_jump_references_enabled = 1 + +" Auto group results by filename +let g:any_jump_grouping_enabled = 0 + +" Amount of preview lines for each search result +let g:any_jump_preview_lines_count = 5 + +" Max search results, other results can be opened via [a] +let g:any_jump_max_search_results = 10 + +" Prefered search engine: rg or ag +let g:any_jump_search_prefered_engine = 'rg' + + +" Search results list styles: +" - 'filename_first' +" - 'filename_last' +let g:any_jump_results_ui_style = 'filename_first' + +" Any-jump window size & position options +let g:any_jump_window_width_ratio = 0.6 +let g:any_jump_window_height_ratio = 0.6 +let g:any_jump_window_top_offset = 4 + +" Customize any-jump colors with extending default color scheme: +" let g:any_jump_colors = { "help": "Comment" } + +" Or override all default colors +let g:any_jump_colors = { + \"plain_text": "Comment", + \"preview": "Comment", + \"preview_keyword": "Operator", + \"heading_text": "Function", + \"heading_keyword": "Identifier", + \"group_text": "Comment", + \"group_name": "Function", + \"more_button": "Operator", + \"more_explain": "Comment", + \"result_line_number": "Comment", + \"result_text": "Statement", + \"result_path": "String", + \"help": "Comment" + \} + +" Disable default any-jump keybindings (default: 0) +let g:any_jump_disable_default_keybindings = 1 + +" Remove comments line from search results (default: 1) +let g:any_jump_remove_comments_from_results = 1 + +" Custom ignore files +" default is: ['*.tmp', '*.temp'] +let g:any_jump_ignored_files = ['*.tmp', '*.temp'] + +" Search references only for current file type +" (default: false, so will find keyword in all filetypes) +let g:any_jump_references_only_for_current_filetype = 0 + +" Disable search engine ignore vcs untracked files +" (default: false, search engine will ignore vcs untracked files) +let g:any_jump_disable_vcs_ignore = 0 + +let g:any_jump_colors = { + \"plain_text": "Comment", + \"preview": "Comment", + \"preview_keyword": "Operator", + \"heading_text": "Function", + \"heading_keyword": "Identifier", + \"group_text": "Comment", + \"group_name": "Function", + \"more_button": "Operator", + \"more_explain": "Comment", + \"result_line_number": "Comment", + \"result_text": "Statement", + \"result_path": "String", + \"help": "Comment" + \} diff --git a/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim b/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim new file mode 100644 index 0000000..6e0d79e --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim @@ -0,0 +1,2 @@ +Plug 'preservim/nerdcommenter' +" quick commenter diff --git a/dotfiles/.config/nvim/plugconfig/townk/vim-autoclose.vim b/dotfiles/.config/nvim/plugconfig/townk/vim-autoclose.vim new file mode 100644 index 0000000..3eb6f1b --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/townk/vim-autoclose.vim @@ -0,0 +1,2 @@ +"Automatically close parenthesis, etc #Origin-Matt +Plug 'townk/vim-autoclose' diff --git a/dotfiles/.config/nvim/plugconfig/tpope/vim-repeat.vim b/dotfiles/.config/nvim/plugconfig/tpope/vim-repeat.vim new file mode 100644 index 0000000..7407b74 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/tpope/vim-repeat.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-repeat' diff --git a/dotfiles/.config/nvim/plugconfig/voldikss/vim-floaterm.vim b/dotfiles/.config/nvim/plugconfig/voldikss/vim-floaterm.vim new file mode 100644 index 0000000..299899a --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/voldikss/vim-floaterm.vim @@ -0,0 +1,7 @@ +" +++++++++++++++++++++ vim-float-term configuration +++++++++++++++++++++++++ +" Integrated Floating terminal +Plug 'voldikss/vim-floaterm' + +let g:floaterm_keymap_new = '.' +let g:floaterm_position = 'center' +let g:floaterm_type = 'normal' diff --git a/dotfiles/.config/nvim/plugins.vim b/dotfiles/.config/nvim/plugins.vim new file mode 100644 index 0000000..3f0ac96 --- /dev/null +++ b/dotfiles/.config/nvim/plugins.vim @@ -0,0 +1,200 @@ +" ============================================================================ +" Vim-plug initialization +let vim_plug_just_installed = 0 +let vim_plug_path = expand('~/.config/nvim/autoload/plug.vim') +if !filereadable(vim_plug_path) + echo "Installing Vim-plug..." + echo "" silent !mkdir -p "$HOME/.config/nvim/autoload" + silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + let vim_plug_just_installed = 1 +endif + +" manually load vim-plug the first time +if vim_plug_just_installed + :execute 'source '.fnameescape(vim_plug_path) + :PlugInstall +endif + +" ============================================================================ +" Source plugs +call plug#begin('~/.config/nvim/plugged') +" Use ,e to jump to plugin config files. +nnoremap e viW"ay :e a +" Use ,g to jump to plugin readme on github. +" Use ,x to format +" TODO + " Plug 'junegunn/vim-emoji' -> runtime plugconfig/junegunn/vim-emoji +runtime plugconfig/junegunn/vim-emoji.vim +runtime plugconfig/pechorin/any-jump.vim +runtime plugconfig/townk/vim-autoclose.vim +runtime plugconfig/tpope/vim-repeat.vim +runtime plugconfig/liuchengxu/vim-which-key.vim +runtime plugconfig/airblade/vim-rooter.vim +runtime plugconfig/luochen1990/rainbow.vim +runtime plugconfig/preservim/nerdcommenter.vim +runtime plugconfig/neoclide/coc.vim.vim +runtime plugconfig/arielrossanigo/dir-configs-override.vim.vim +runtime plugconfig/voldikss/vim-floaterm.vim +runtime plugconfig/honza/vim-snippets' +Plug 'justinmk/vim-sneak' +runtime plugconfig/unblevable/quick-scope.vim +Plug 'unblevable/quick-scope' +" TODO GITHUB DASHBOARD +Plug 'junegunn/vim-github-dashboard' +" Better file browser +Plug 'preservim/nerdtree' +" NERDTree ----------------------------- +" toggle nerdtree display +map :NERDTreeToggle +nmap :NERDTreeFind +" open nerdtree with the current file selected +" don't show these file types +let NERDTreeIgnore = ['\.pyc$', '\.pyo$'] + + +" Tagbar ----------------------------- +Plug 'majutsushi/tagbar' +" TODO known problems: +" * current block not refreshing' +" +" toggle tagbar display +nmap tb :TagbarToggle + +" autofocus on tagbar open +let g:tagbar_autofocus = 1 + + +" Search results counter +Plug 'vim-scripts/IndexedSearch' + +" Plugin for live preview of LaTex +Plug 'donRaphaco/neotex', {'for': 'tex'} + + + +" Lightline +" Lightline Themes Configurations +Plug 'itchyny/lightline.vim' +let g:lightline = { + \ 'colorscheme': 'simpleblack', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'cocstatus': 'coc#status' + \ }, + \ } +runtime plugconfig/junegunn/fzf.vim + +" Pending tasks list +Plug 'fisadev/FixedTaskList.vim' +" Tasklist ------------------------------ +" show pending tasks list +map tl :TaskList + + +" Completion from other opened files +Plug 'Shougo/context_filetype.vim' + +" Autoclose ------------------------------ +" Automatically close parenthesis, etc +Plug 'Townk/vim-autoclose' +" Fix to let ESC work as espected with Autoclose plugin +" (without this, when showing an autocompletion window, ESC won't leave insert +" mode) +let g:AutoClosePumvisible = {"ENTER": "\", "ESC": "\"} +let g:AutoClosePairs = "() {} [] ' ` \" " + + +" Indent text object +Plug 'michaeljsmith/vim-indent-object' + +" Indentation based movements +Plug 'jeetsukumaran/vim-indentwise' + +" Better language packs +Plug 'sheerun/vim-polyglot' + +" Ack code search (requires ack installed in the system) +Plug 'mileszs/ack.vim' +" TODO is there a way to prevent the progress which hides the editor? + +" Paint css colors with the real color +Plug 'lilydjwg/colorizer' +" TODO is there a better option for neovim? + +" Generate html in a simple way +Plug 'mattn/emmet-vim' +" Emmet mappings +let g:user_emmet_mode='a' " enable all functions in all modes +let g:user_emmet_leader_key='' + + +" Git integration +Plug 'tpope/vim-fugitive' + +" Signify ------------------------------ +" Git/mercurial/others diff icons on the side of the file lines +Plug 'mhinz/vim-signify' +" this first setting decides in which order try to guess your current vcs +" UPDATE it to reflect your preferences, it will speed up opening files +let g:signify_vcs_list = [ 'git', 'hg' ] +" mappings to jump to changed blocks +nmap sn (signify-next-hunk) +nmap sp (signify-prev-hunk) + +" nicer colors +highlight DiffAdd cterm=bold ctermbg=none ctermfg=119 +highlight DiffDelete cterm=bold ctermbg=none ctermfg=167 +highlight DiffChange cterm=bold ctermbg=none ctermfg=227 +highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119 +highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167 +highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227 + + +" Linters +Plug 'neomake/neomake' +" TODO is it running on save? or when? +" TODO not detecting errors, just style, is it using pylint? + + +" Nice icons: Need to install patched font for this to work +Plug 'ryanoasis/vim-devicons' +" This is solves a bug in devicons that appears when sourcing vimrc +if exists("g:loaded_webdevicons") + call webdevicons#refresh() +endif +" Devicon Configurations +" loading the plugin +let g:webdevicons_enable = 1 + + + +" add or override individual additional filetypes +let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols = {} " needed +let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['mkv'] = 'ƛ' + +" Show indention level through lines +Plug 'Yggdroot/indentLine' +" Indention Config +let g:indentLine_char = '┊' + + +" Distraction free programming +Plug 'junegunn/goyo.vim' +" Goyo mappings +nmap :Goyo 60x60 + + +" Tell vim-plug we finished declaring plugins, so it can load them +call plug#end() + +" ============================================================================ +" Install plugins the first time vim runs +if vim_plug_just_installed + echo "Installing Bundles, please ignore key map error messages" + :PlugInstall +endif + + diff --git a/dotfiles/.config/nvim/settings.vim b/dotfiles/.config/nvim/settings.vim new file mode 100644 index 0000000..6b7ea8c --- /dev/null +++ b/dotfiles/.config/nvim/settings.vim @@ -0,0 +1,42 @@ +" ------------------------------------------------------------------------------ +" Neoconfig by Shawn Anderson starting September 30 2020 +set autochdir +set noswapfile +" +" ------------------------------------------------------------------------------ +" These are inherited from MattCoding4Days +"" Make vim scroll faster +set ttyfast +set mouse=a +set lazyredraw +set nu +set nowrap +set relativenumber +set encoding=UTF-8 +" set tabline to not display full path +set guitablabel=%t + +" tabs and spaces handling +set expandtab +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +" remove ugly vertical lines on window division +set fillchars+=vert:\ + +" autocompletion of files and commands behaves like shell +" (complete only the common part, list the options that match) +set wildmode=list:longest + +" when scrolling, keep cursor 3 lines away from screen border +set scrolloff=3 + + +" fix problems with uncommon shells (fish, xonsh) and plugins running commands +" (neomake, ...) +set shell=$SHELL + +" save as sudo +ca w!! w !sudo tee "%" + + diff --git a/dotfiles/.config/nvim/themes.vim b/dotfiles/.config/nvim/themes.vim new file mode 100644 index 0000000..a1e9ce4 --- /dev/null +++ b/dotfiles/.config/nvim/themes.vim @@ -0,0 +1,23 @@ + +"" Color Scheme set up for Material =============================== +if (has("nvim")) + "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 > + let $NVIM_TUI_ENABLE_TRUE_COLOR=1 +endif + +" < https://github.com/neovim/neovim/wiki/Following-HEAD #20160511 > +if (has("termguicolors")) + set termguicolors +endif + +" use 256 colors when possible +if (&term =~? 'mlterm\|xterm\|xterm-256\|screen-256') || has('nvim') + let &t_Co = 256 + syntax on + set background=light + colorscheme quantum +else + colorscheme jellybeans +endif + + diff --git a/dotfiles/.config/tmux/init.tmux b/dotfiles/.config/tmux/init.tmux new file mode 100644 index 0000000..1cb57e5 --- /dev/null +++ b/dotfiles/.config/tmux/init.tmux @@ -0,0 +1,215 @@ +# Changed prefix to C-Space October 10th +# Set prefix to Ctrl-Space +# unbind C-b +# set -g prefix C-Space +# bind Space send-prefix +# Set the prefix to ^A +unbind C-b +set -g prefix ^A + +# change pane numbers to start with 1 instead of 0 +set -g base-index 1 +set -g pane-base-index 1 + +# Set fish as default shell +set -g default-shell /usr/bin/fish + +# screen ^C c +unbind ^C +bind ^C new-window -c '#{pane_current_path}' +bind c new-window -c '#{pane_current_path}' + + +# No lag after ESC. +set -sg escape-time 5 + +set -g visual-bell on + +#urxvt tab like window switching (-n: no prior escape seq) +bind -n S-down new-window +bind -n S-left prev +bind -n S-right next +bind -n C-left swap-window -t -1 +bind -n C-right swap-window -t +1 + +# Surfraw shortcuts +# bind -n g send-keys -t . "sr google " +bind -n g send-keys -t . "g" + + +# zoom a pane into a new window for temporary work +# unbind + +# bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom +# unbind - +# bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom + +# dont automatically rename windows +set-option -g allow-rename off + +#detach ^D d +unbind ^D +bind ^D detach + +unbind p +bind p previous-window + +# Break pane into it's own window +unbind b +bind b break-pane + +#remove prompt from kill +unbind x +bind x kill-pane +# -a is for all panes except current +bind C-x kill-pane -a + +# windows ^W w +unbind ^W +bind ^W list-windows +unbind w +bind w list-windows + +#redisplay ^L l +unbind ^L +bind ^L refresh-client + +#quick reload and edit config +bind-key r source-file ~/.tmux.conf \; display-message "Tmux config reloaded" +bind-key e split-window -h "nvim ~/.config/tmux/init.tmux" + +# split windows like vim +bind s split-window -v -c '#{pane_current_path}' +bind v split-window -h -c '#{pane_current_path}' + +# move around panes with hjkl +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +unbind l +bind l select-pane -R + +#activate mouse +set -g mouse on + +# From https://github.com/tmux/tmux/issues/1320 +# Emulate scrolling by sending up and down keys if these commands are running in the pane +tmux_commands_with_legacy_scroll="nano less more man git" + +bind-key -T root WheelUpPane \ + if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ + 'send -Mt=' \ + 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ + "send -t= Up" "copy-mode -et="' + +bind-key -T root WheelDownPane \ + if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ + 'send -Mt=' \ + 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ + "send -t= Down" "send -Mt="' + + + +# vi-style controls for copy-mode +setw -g mode-keys vi +setw -g xterm-keys on + +# Get 24 bit colors +set -g default-terminal "tmux-256color" # or tmux-256color +set -ga terminal-overrides ",*256col*:Tc" +# set -ga terminal-overrides ",xterm-256color:Tc" +# set -ga terminal-overrides 'xterm*:smcup@:rmcup@' + +# Recommended by nvim from ':checkhealth' +set-option -sg escape-time 0 + +# Nord Theme +# Powerline +run-shell "powerline-daemon -q" +# source "$/home/shawn/.config/powerline/themes/tmux///tmux/powerline.conf" +# set -g status-right '' + +# set -g @plugin "arcticicestudio/nord-tmux" +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @continuum-save-interval '15' +set -g @continuum-restore 'off' +set -g @plugin 'tmux-plugins/tmux-continuum' +# run -b "~/.config/serious-tmux/serious/plugins/tpm/tpm" + +set -g status-right-length 240 +set -g status-left-length 140 + +set -g status-right 'Continuum status: #{continuum_status}' +# set -g status-left 'Continuum status: #{continuum_status}' + +set -g status-right "#{pane_current_path} " +set -ag status-right "#{prefix_highlight}" +set -ag status-right '#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] Continuum: #{@continuum-restore} #[fg=white,bg=brightblack,nobold,noitalics,nounderscore] ' +# run -b "~/.config/serious-tmux/serious/plugins/tpm/tpm" +# run-shell "~/.config/serious-tmux/serious/plugins/nord-tmux/nord.tmux" +# set -ag status-left "#{prefix_highlight}" + +# set -g pane-border-status on +set -g pane-border-style "bg=default,fg=default" +set -g pane-active-border-style "bg=default,fg=green" +# Pane naming +# toggle pane title visibility from https://github.com/tmux/tmux/issues/680 +bind H run 'zsh -c "arr=( off top ) && tmux setw pane-border-status \${arr[\$(( \${arr[(I)#{pane-border-status}]} % 2 + 1 ))]}"' + +# rename pane +bind P command-prompt -p "(rename-pane)" -I "#T" "select-pane -T '%%'" + +# Choose Tree +unbind t +bind t choose-tree + +# The following 10 lines are all from https://gitlab.com/protesilaos/dotfiles/blob/master/tmux/.tmux.conf +# copy mode +# Vim copy-paste behaviour using the clipboard +# bind -T copy-mode-vi v send-keys -X begin-selection +unbind -T copy-mode-vi v +# bind -T copy-mode-vi y send-keys -X copy-pipe "xclip -selection clipboard -i" +unbind -T copy-mode-vi y +# bind -T copy-mode-vi r send-keys -X rectangle-toggle +unbind -T copy-mode-vi r +# For vi copy mode bindings +# bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" +unbind -T copy-mode-vi MouseDragEnd1Pane +# For emacs copy mode bindings +# bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" +unbind -T copy-mode MouseDragEnd1Pane + + +# set -g status-utf9 on +# set -ag window-status-current-format "#[fg=black,bg=white,nobold,noitalics,nounderscore]" +# set -ag window-status-current-format "#[fg=black,bg=white]#P #{pane-border-status} #{pane-current-command}" +# set -ag window-status-current-format "#[fg=black,bg=white,nobold,noitalics,nounderscore]" +# set -ag window-status-current-format "#[fg=black,bg=white]#{pane_current_command}" +# set -ag window-status-current-format "#[fg=white,bg=black,nobold,noitalics,nounderscore]" +# set -ag window-status-current-format "#[fg=red,bg=black] #{pane_current_path}" +# set -ag window-status-current-format ' ' + +# ------------------------------------------------------------------------------ +# From https://www.rockyourcode.com/copy-and-paste-in-tmux/ +# Use vim keybindings in copy mode +set-option -g mouse on +setw -g mode-keys vi +set-option -s set-clipboard off +bind P paste-buffer +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X rectangle-toggle +unbind -T copy-mode-vi Enter +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i' +# +# [ Now Enters copy mode +# Navigate the copy mode with vi-like-key bindings (u for up, d for down, etc.) +# Hit v to start copying. +# Press y or Enter to copy the text into the tmux buffer. This automatically cancels copy mode. +# Paste into the buffer with +P (make sure that it’s uppercase P). +# +# Or alternatively, use the mouse to copy text after you’ve entered copy mode. +# +# The above commands use xclip, a Linux command line tool for X11. You can +# replace xclip -se c -i with a platform-specific command like pbcopy (MacOS) or +# wl-copy (Wayland). diff --git a/dotfiles/.tmux.conf b/dotfiles/.tmux.conf index dd4c7dc..041dccb 100755 --- a/dotfiles/.tmux.conf +++ b/dotfiles/.tmux.conf @@ -1,215 +1 @@ -# Changed prefix to C-Space October 10th -# Set prefix to Ctrl-Space -# unbind C-b -# set -g prefix C-Space -# bind Space send-prefix -# Set the prefix to ^A -unbind C-b -set -g prefix ^A - -# change pane numbers to start with 1 instead of 0 -set -g base-index 1 -set -g pane-base-index 1 - -# Set fish as default shell -set -g default-shell /usr/bin/fish - -# screen ^C c -unbind ^C -bind ^C new-window -c '#{pane_current_path}' -bind c new-window -c '#{pane_current_path}' - - -# No lag after ESC. -set -sg escape-time 5 - -set -g visual-bell on - -#urxvt tab like window switching (-n: no prior escape seq) -bind -n S-down new-window -bind -n S-left prev -bind -n S-right next -bind -n C-left swap-window -t -1 -bind -n C-right swap-window -t +1 - -# Surfraw shortcuts -# bind -n g send-keys -t . "sr google " -bind -n g send-keys -t . "g" - - -# zoom a pane into a new window for temporary work -# unbind + -# bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom -# unbind - -# bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom - -# dont automatically rename windows -set-option -g allow-rename off - -#detach ^D d -unbind ^D -bind ^D detach - -unbind p -bind p previous-window - -# Break pane into it's own window -unbind b -bind b break-pane - -#remove prompt from kill -unbind x -bind x kill-pane -# -a is for all panes except current -bind C-x kill-pane -a - -# windows ^W w -unbind ^W -bind ^W list-windows -unbind w -bind w list-windows - -#redisplay ^L l -unbind ^L -bind ^L refresh-client - -#quick reload and edit config -bind-key r source-file ~/.tmux.conf \; display-message "Tmux config reloaded" -bind-key e split-window -h "nvim ~/.tmux.conf" - -# split windows like vim -bind s split-window -v -c '#{pane_current_path}' -bind v split-window -h -c '#{pane_current_path}' - -# move around panes with hjkl -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -unbind l -bind l select-pane -R - -#activate mouse -set -g mouse on - -# From https://github.com/tmux/tmux/issues/1320 -# Emulate scrolling by sending up and down keys if these commands are running in the pane -tmux_commands_with_legacy_scroll="nano less more man git" - -bind-key -T root WheelUpPane \ - if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ - 'send -Mt=' \ - 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ - "send -t= Up" "copy-mode -et="' - -bind-key -T root WheelDownPane \ - if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \ - 'send -Mt=' \ - 'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \ - "send -t= Down" "send -Mt="' - - - -# vi-style controls for copy-mode -setw -g mode-keys vi -setw -g xterm-keys on - -# Get 24 bit colors -set -g default-terminal "tmux-256color" # or tmux-256color -set -ga terminal-overrides ",*256col*:Tc" -# set -ga terminal-overrides ",xterm-256color:Tc" -# set -ga terminal-overrides 'xterm*:smcup@:rmcup@' - -# Recommended by nvim from ':checkhealth' -set-option -sg escape-time 0 - -# Nord Theme -# Powerline -run-shell "powerline-daemon -q" -# source "$/home/shawn/.config/powerline/themes/tmux///tmux/powerline.conf" -# set -g status-right '' - -# set -g @plugin "arcticicestudio/nord-tmux" -set -g @plugin 'tmux-plugins/tmux-prefix-highlight' -set -g @plugin 'tmux-plugins/tmux-resurrect' -set -g @continuum-save-interval '15' -set -g @continuum-restore 'off' -set -g @plugin 'tmux-plugins/tmux-continuum' -# run -b "~/.config/serious-tmux/serious/plugins/tpm/tpm" - -set -g status-right-length 240 -set -g status-left-length 140 - -set -g status-right 'Continuum status: #{continuum_status}' -# set -g status-left 'Continuum status: #{continuum_status}' - -set -g status-right "#{pane_current_path} " -set -ag status-right "#{prefix_highlight}" -set -ag status-right '#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] Continuum: #{@continuum-restore} #[fg=white,bg=brightblack,nobold,noitalics,nounderscore] ' -# run -b "~/.config/serious-tmux/serious/plugins/tpm/tpm" -# run-shell "~/.config/serious-tmux/serious/plugins/nord-tmux/nord.tmux" -# set -ag status-left "#{prefix_highlight}" - -# set -g pane-border-status on -set -g pane-border-style "bg=default,fg=default" -set -g pane-active-border-style "bg=default,fg=green" -# Pane naming -# toggle pane title visibility from https://github.com/tmux/tmux/issues/680 -bind H run 'zsh -c "arr=( off top ) && tmux setw pane-border-status \${arr[\$(( \${arr[(I)#{pane-border-status}]} % 2 + 1 ))]}"' - -# rename pane -bind P command-prompt -p "(rename-pane)" -I "#T" "select-pane -T '%%'" - -# Choose Tree -unbind T -bind T choose-tree - -# The following 10 lines are all from https://gitlab.com/protesilaos/dotfiles/blob/master/tmux/.tmux.conf -# copy mode -# Vim copy-paste behaviour using the clipboard -# bind -T copy-mode-vi v send-keys -X begin-selection -unbind -T copy-mode-vi v -# bind -T copy-mode-vi y send-keys -X copy-pipe "xclip -selection clipboard -i" -unbind -T copy-mode-vi y -# bind -T copy-mode-vi r send-keys -X rectangle-toggle -unbind -T copy-mode-vi r -# For vi copy mode bindings -# bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" -unbind -T copy-mode-vi MouseDragEnd1Pane -# For emacs copy mode bindings -# bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" -unbind -T copy-mode MouseDragEnd1Pane - - -# set -g status-utf9 on -# set -ag window-status-current-format "#[fg=black,bg=white,nobold,noitalics,nounderscore]" -# set -ag window-status-current-format "#[fg=black,bg=white]#P #{pane-border-status} #{pane-current-command}" -# set -ag window-status-current-format "#[fg=black,bg=white,nobold,noitalics,nounderscore]" -# set -ag window-status-current-format "#[fg=black,bg=white]#{pane_current_command}" -# set -ag window-status-current-format "#[fg=white,bg=black,nobold,noitalics,nounderscore]" -# set -ag window-status-current-format "#[fg=red,bg=black] #{pane_current_path}" -# set -ag window-status-current-format ' ' - -# ------------------------------------------------------------------------------ -# From https://www.rockyourcode.com/copy-and-paste-in-tmux/ -# Use vim keybindings in copy mode -set-option -g mouse on -setw -g mode-keys vi -set-option -s set-clipboard off -bind P paste-buffer -bind-key -T copy-mode-vi v send-keys -X begin-selection -bind-key -T copy-mode-vi y send-keys -X rectangle-toggle -unbind -T copy-mode-vi Enter -bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' -bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i' -# -# [ Now Enters copy mode -# Navigate the copy mode with vi-like-key bindings (u for up, d for down, etc.) -# Hit v to start copying. -# Press y or Enter to copy the text into the tmux buffer. This automatically cancels copy mode. -# Paste into the buffer with +P (make sure that it’s uppercase P). -# -# Or alternatively, use the mouse to copy text after you’ve entered copy mode. -# -# The above commands use xclip, a Linux command line tool for X11. You can -# replace xclip -se c -i with a platform-specific command like pbcopy (MacOS) or -# wl-copy (Wayland). +source-file ~/.config/tmux/init.tmux