Modularized vim. Also linking tmux to init.tmux now. Lot's of hack and slash on vim, in fact, some things might be broken now, but you got to break some eggs to make an omelette. Checkpointing here.
This commit is contained in:
parent
a79d282037
commit
bf629e6abe
|
|
@ -5,3 +5,4 @@ dotfiles/.config/tmux/serious
|
|||
|
||||
|
||||
library/
|
||||
tags
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
/home/ygg/.config/fish/fisher/fish-fzf/fzf_key_bindings.fish
|
||||
/home/ygg/.fzf/shell/key-bindings.fish
|
||||
|
|
@ -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 <silent> <leader>b Oimport ipdb; ipdb.set_trace()<esc>
|
||||
|
||||
|
||||
|
||||
" 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
library/MattDev_NvimConfig⛺/custom.vim
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
"------------------------------------------------------------------------------
|
||||
" Inherited from MattCoding4Days
|
||||
" remap default leader key to comma
|
||||
let mapleader = ","
|
||||
nnoremap <leader>r :source $MYVIMRC<CR>
|
||||
nnoremap <leader>e :e $MYVIMRC<CR>
|
||||
nnoremap <leader>w :w<CR>
|
||||
nnoremap <leader>i :w<CR>:source $MYVIMRC<CR>:PlugInstall<CR>
|
||||
|
||||
|
||||
" Change Ctrl N mapping to Ctrl Space "
|
||||
inoremap <C-space> <C-n>
|
||||
|
||||
|
||||
" " Copy to clipboard
|
||||
vnoremap <leader>y "+y
|
||||
nnoremap <leader>Y "+yg_
|
||||
nnoremap <leader>y "+y
|
||||
nnoremap <leader>yy "+yy
|
||||
|
||||
" " Paste from clipboard
|
||||
nnoremap <leader>p "+p
|
||||
nnoremap <leader>P "+P
|
||||
vnoremap <leader>p "+p
|
||||
vnoremap <leader>P "+P
|
||||
|
||||
|
||||
" tab navigation mappings
|
||||
map tt :tabnew
|
||||
map <M-Right> :tabn<CR>
|
||||
imap <M-Right> <ESC>:tabn<CR>
|
||||
map <M-Left> :tabp<CR>
|
||||
imap <M-Left> <ESC>:tabp<CR>
|
||||
|
||||
" clear search results
|
||||
nnoremap <silent> // :noh<CR>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
Plug 'airblade/vim-rooter'
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
" Override configs by directory
|
||||
Plug 'arielrossanigo/dir-configs-override.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 <C-p> :Commands<CR>fzf#
|
||||
nnoremap <C-p><C-p> :History<CR>
|
||||
nnoremap <C-p><C-r> :History:<CR>
|
||||
nnoremap <C-p><C-s> :History/<CR>
|
||||
nnoremap <C-p><C-t> :Files<CR>
|
||||
nnoremap <C-p><C-c> :Colors<CR>
|
||||
nnoremap <C-p><C-w> :Windows<CR>
|
||||
nnoremap <C-p><C-k> :Commands<CR>
|
||||
nnoremap <C-p><C-h> :Helptags<CR>
|
||||
nnoremap <C-p><C-m> :Maps<CR>
|
||||
nnoremap <C-p><C-b> :Buffers<CR>
|
||||
10
dotfiles/.config/nvim/plugconfig/junegunn/node_modules/.yarn-integrity
generated
vendored
Normal file
10
dotfiles/.config/nvim/plugconfig/junegunn/node_modules/.yarn-integrity
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"systemParams": "linux-x64-64",
|
||||
"modulesFolders": [],
|
||||
"flags": [],
|
||||
"linkedModules": [],
|
||||
"topLevelPatterns": [],
|
||||
"lockfileEntries": {},
|
||||
"files": [],
|
||||
"artifacts": {}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Plug 'liuchengxu/vim-which-key'
|
||||
nnoremap <silent> <leader> :WhichKey ','<CR>
|
||||
"autocmd! User vim-which-key call which_key#register(',', 'g:which_key_map')
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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 <tab>' to make sure tab is not mapped by other plugin.
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
|
||||
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||||
" Coc only does snippet and additional edit on confirm.
|
||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
" Or use `complete_info` if your vim support it, like:
|
||||
" inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
|
||||
" Use `[g` and `]g` to navigate diagnostics
|
||||
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
||||
|
||||
" Remap keys for gotos
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
|
||||
" Use K to show documentation in preview window
|
||||
"nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
else
|
||||
call CocAction('doHover')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Highlight symbol under cursor on CursorHold
|
||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||
|
||||
" Remap for rename current word
|
||||
nmap <leader>rn <Plug>(coc-rename)
|
||||
|
||||
" Remap for format selected region
|
||||
"xmap <leader>fr <Plug>(coc-format-selected)
|
||||
"nmap <leader>fr <Plug>(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: `<leader>aap` for current paragraph
|
||||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
|
||||
" Remap for do codeAction of current line
|
||||
nmap <leader>ac <Plug>(coc-codeaction)
|
||||
" Fix autofix problem of current line
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
|
||||
" Create mappings for function text object, requires document symbols feature of languageserver.
|
||||
xmap if <Plug>(coc-funcobj-i)
|
||||
xmap af <Plug>(coc-funcobj-a)
|
||||
omap if <Plug>(coc-funcobj-i)
|
||||
omap af <Plug>(coc-funcobj-a)
|
||||
|
||||
" Use <TAB> for select selections ranges, needs server support, like: coc-tsserver, coc-python
|
||||
nmap <silent> <TAB> <Plug>(coc-range-select)
|
||||
xmap <silent> <TAB> <Plug>(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', <f-args>)
|
||||
|
||||
" 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 <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||
" Manage extensions
|
||||
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
||||
" Show commands
|
||||
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
||||
" Find symbol of current document
|
||||
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||
" Search workspace symbols
|
||||
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||
" Do default action for next item.
|
||||
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||
" Do default action for previous item.
|
||||
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||
" Resume latest coc list
|
||||
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
Plug 'pechorin/any-jump.vim'
|
||||
|
||||
" Normal mode: Jump to definition under cursore
|
||||
"nnoremap <leader>j :AnyJump<CR>
|
||||
|
||||
" Visual mode: jump to selected text in visual mode
|
||||
"xnoremap <leader>j :AnyJumpVisual<CR>
|
||||
|
||||
" Normal mode: open previous opened file (after jump)
|
||||
"nnoremap <leader>ab :AnyJumpBack<CR>
|
||||
|
||||
" Normal mode: open last closed search window again
|
||||
"nnoremap <leader>al :AnyJumpLastResults<CR>
|
||||
|
||||
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"
|
||||
\}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Plug 'preservim/nerdcommenter'
|
||||
" quick commenter
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"Automatically close parenthesis, etc #Origin-Matt
|
||||
Plug 'townk/vim-autoclose'
|
||||
|
|
@ -0,0 +1 @@
|
|||
Plug 'tpope/vim-repeat'
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
" +++++++++++++++++++++ vim-float-term configuration +++++++++++++++++++++++++
|
||||
" Integrated Floating terminal
|
||||
Plug 'voldikss/vim-floaterm'
|
||||
|
||||
let g:floaterm_keymap_new = '<leader>.'
|
||||
let g:floaterm_position = 'center'
|
||||
let g:floaterm_type = 'normal'
|
||||
|
|
@ -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 <buffer> <leader>e viW"ay :e <C-r>a<CR>
|
||||
" 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 <C-n> :NERDTreeToggle<CR>
|
||||
nmap <leader><C-n> :NERDTreeFind<CR>
|
||||
" 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 <leader>tb :TagbarToggle<CR>
|
||||
|
||||
" 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 <leader>tl :TaskList<CR>
|
||||
|
||||
|
||||
" 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": "\<C-Y>", "ESC": "\<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='<C-S>'
|
||||
|
||||
|
||||
" 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 <leader>sn <plug>(signify-next-hunk)
|
||||
nmap <leader>sp <plug>(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 <C-g> :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
|
||||
|
||||
|
||||
|
|
@ -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 "%"
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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'
|
||||
#
|
||||
# <c-a>[ 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 <prefix>+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).
|
||||
|
|
@ -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'
|
||||
#
|
||||
# <c-a>[ 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 <prefix>+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
|
||||
|
|
|
|||
Loading…
Reference in New Issue