diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json index d796075..a82f0bf 100644 --- a/.config/nvim/coc-settings.json +++ b/.config/nvim/coc-settings.json @@ -53,6 +53,7 @@ "html" ], "coc.preferences.currentFunctionSymbolAutoUpdate": true, + "coc.preferences.snippetStatusText": "Ⓢ ", "codeLens.enable": true, "signature.triggerSignatureWait": 100, "session.saveOnVimLeave": false, @@ -60,8 +61,10 @@ "list.source.files.args": ["-t", "f", "-S", "-2m", "-F", "-H"], "list.source.grep.args": ["--vimgrep", "--hiden", "--no-heading"], "list.source.mru.ignoreGitIgnore": true, - "list.previewSplitRight": true, + "list.previewSplitRight": true, "explorer.width": 30, + "explorer.icon.expanded": "▾", + "explorer.icon.collapsed": "▸", "explorer.icon.enableNerdfont": true, "explorer.buffer.columns": ["selection", "bufnr", "name", "modified"], "explorer.file.columns": [ @@ -80,6 +83,13 @@ "dd": "deleteForever", "b": "search" }, + "emmet.includeLanguages": { + "html.handlebars": "html", + "javascript": "javascriptreact" + }, + "tsserver.enableJavascript": true, + "tslint.enable": true, + "tslint.autoFixOnSave": true, "eslint.trace.server": "verbose", "eslint.autoFix": true, "eslint.autoFixOnSave": true, @@ -89,8 +99,9 @@ "typescript", "typescriptreact", "javascriptreact" - ], - "prettier.eslintIntegration": true, - "prettier.stylelintIntegration": true, - "prettier.disableSuccessMessage": true + ] + // "prettier.eslintIntegration": true, + // "prettier.stylelintIntegration": true, + // "prettier.disableSuccessMessage": true, + // "prettier.onlyUseLocalVersion": true } diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 90f2ee1..d4cbaef 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -5,23 +5,14 @@ let g:python_host_skip_check=1 " Skip python 2 host check let g:python3_host_prog = '/usr/bin/python3' let g:tagbar_ctags_bin = '/usr/bin/ctags' let python_highlight_all=1 -set inccommand=nosplit " Live preview of substitutes and other similar commands - -" Plug updates itself automatically -if empty(glob('~/.config/nvim/autoload/plug.vim')) - silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - au VimEnter * PlugInstall --sync | source $MYVIMRC -endif - -set grepprg=rg\ --vimgrep\ --hidden\ --no-heading -set grepformat=%f:%l:%c:%m,%f:%l:%m " }}} " Plugins {{{ call plug#begin('~/.config/nvim/plugged') Plug 'w0rp/ale' +Plug 'othree/yajs.vim', {'for': 'javascript'} +Plug 'othree/es.next.syntax.vim', {'for': 'javascript'} +Plug 'mhartington/nvim-typescript', {'do': './install.sh', 'for': 'typescript'} Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'yuezk/vim-js', {'for': 'javascript'} Plug 'sheerun/vim-polyglot' Plug 'liuchengxu/vista.vim' Plug 'tmsvg/pear-tree' @@ -33,13 +24,15 @@ call plug#end() " Options {{{ set path+=** set binary +set inccommand=nosplit " Live preview of substitutes and other similar commands set clipboard^=unnamedplus " system clipboard (requires +clipboard) set fileencoding=utf-8 " The encoding written to file. set shell=/bin/zsh " Setting shell to zsh set number " Line numbers on set relativenumber " For easier line jumps -set noshowmode " It's on the statusline +set noshowmode " Always hide mode set laststatus=2 " Always show statusline +set showtabline=2 " Always Show tabline set pumheight=12 " Completion window max size set helpheight=12 " Minimum help window height set noswapfile " New buffers will be loaded without creating a swapfile @@ -60,16 +53,18 @@ set cursorline " Hightlight the screen line of the cursor set visualbell " Use visual bell instead of beeping set scrolloff=5 " Keep this many lines padding when scrolling set shortmess+=aoOIWcs " Shorten messages and don't show intro -set tabstop=4 " Number of spaces a equals set foldnestmax=10 " Deepest fold is 10 levels set foldmethod=marker " Markers are used to specify folds. -set foldlevelstart=10 set foldclose=all " Folds closed by default -set title +set foldlevelstart=10 set selectmode=key " Shift + arrow keys for selecting text set keymodel=startsel " This one complements the one above it set signcolumn=yes " Gutter for diagnostics and git status -set softtabstop=4 +set tabstop=4 " Number of spaces a equals +set shiftwidth=4 " Number of spaces to use in auto(indent) +set softtabstop=4 " While performing editing operations +set shiftround " Round indent to multiple of 'shiftwidth' +set title set breakindent set redrawtime=500 set ttimeoutlen=10 @@ -86,10 +81,8 @@ set formatoptions+=nj set pastetoggle= set fillchars+=vert:\│ -" Display all matching files when we tab complete -set wildmode=longest:full,full -set wildignorecase -set wildoptions=tagfile +set grepprg=rg\ --vimgrep\ --hidden\ --no-heading +set grepformat=%f:%l:%c:%m,%f:%l:%m if &diff set textwidth=80 @@ -98,10 +91,10 @@ endif match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' let mapleader="\" -let maplocalleader="," +let maplocalleader=',' let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*' -let g:vim_jsx_pretty_colorful_config = 1 +let g:markdown_fenced_languages = ['vim', 'help'] " }}} " {{{ Ale let g:ale_use_global_executables = 1 @@ -115,40 +108,47 @@ let g:ale_close_preview_on_insert = 1 let g:ale_sign_error = '✖' let g:ale_sign_warning = '⚠' let g:ale_sign_info = 'i' -let g:ale_set_loclist = 0 -let g:ale_set_quickfix = 1 +let g:ale_set_balloons = 1 +let g:ale_virtualtext_cursor = 1 let g:ale_loclist_msg_format = '[%linter%] %s% (code)% [%severity%]' let g:ale_set_highlights = 1 let g:ale_set_signs = 1 -let g:ale_set_balloons = 1 +let g:ale_linter_aliases = { +\ 'jsx': ['css', 'javascript'], +\ 'vue': ['vue', 'javascript'], +\} let g:ale_linters = { \ 'javascript': ['prettier_standard'], -\ 'jsx': ['eslint'], +\ 'jsx': ['prettier_standard'], +\ 'typescript': ['tsserver', 'eslint'], \ 'json': ['prettier'], \ 'html': ['prettier'], -\ 'css': ['stylelint', 'eslint'], -\ 'scss': ['stylelint', 'eslint'], +\ 'css': ['stylelint'], +\ 'scss': ['stylelint'], \ 'bash': ['shellcheck'], +\ 'vim': ['vint'], \} let g:ale_fixers = { \ 'javascript': ['prettier_standard'], \ 'jsx': ['prettier_standard'], +\ 'typescript': ['prettier'], \ 'json': ['prettier'], -\ 'css': ['stylelint', 'eslint'], -\ 'scss': ['stylelint', 'eslint'], -\ 'html': ['prettier_standard'], +\ 'scss': ['stylelint'], +\ 'css': ['stylelint'], +\ 'html': ['prettier'], \ 'markdown': ['prettier'], \} let g:ale_pattern_options = { \ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []}, \ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []}, \} -nmap (ale_previous_wrap) -nmap (ale_next_wrap) + +nmap (ale_previous_wrap) +nmap (ale_next_wrap) " }}} " CoC {{{ -let g:coc_global_extensions = ['coc-lists', 'coc-highlight', 'coc-stylelint', 'coc-explorer', 'coc-vimlsp', 'coc-css', 'coc-html', 'coc-json', 'coc-eslint', 'coc-prettier', 'coc-snippets'] +let g:coc_global_extensions = ['coc-lists', 'coc-highlight', 'coc-tsserver', 'coc-emmet', 'coc-stylelint', 'coc-explorer', 'coc-css', 'coc-html', 'coc-json', 'coc-eslint', 'coc-snippets'] " Remap keys for gotos nmap gd (coc-definition) @@ -164,6 +164,9 @@ nnoremap o/ :CocList -I symbols " Explorer nmap :CocCommand explorer +" Config +nnoremap :CocConfig + " Lists nnoremap :CocList -S --ignore-case helptags nnoremap :CocList --ignore-case files @@ -192,13 +195,24 @@ let g:coc_snippet_next = '' let g:coc_snippet_prev = '' "}}} " Vista {{{ -let g:vista_default_executive = 'coc' +let g:vista#renderer#enable_icon = 1 +let g:vista_default_executive = 'ctags' let g:vista_disable_statusline = 1 let g:vista_sidebar_width = 35 -let g:vista#renderer#enable_icon = 1 +let g:vista_executive_for = { + \ 'javascript': 'coc', + \ 'javascript.jsx': 'coc', + \ 'python': 'ctags', + \ } -nnoremap :Vista!! +nnoremap :Vista!! " }}} +" JS {{{ +let g:polyglot_disabled = ['javascript'] +let g:vim_jsx_pretty_colorful_config = 1 +let g:jsx_ext_required = 1 +let g:yats_host_keyword = 1 +"}}} " Colors {{{ set termguicolors let g:oceanic_next_terminal_italic = 1 @@ -211,7 +225,7 @@ function! MyHighlights() abort call matchadd('ColorColumn', '\%81v', 100) endfunction -hi! VertSplit ctermbg=NONE ctermfg=NONE guibg=NONE guifg=#080808 +hi! VertSplit ctermbg=NONE ctermfg=NONE guibg=#080808 guifg=#080808 hi! Comment cterm=italic ctermbg=NONE guibg=NONE hi! Normal ctermbg=NONE guibg=NONE hi! NonText ctermbg=NONE guibg=NONE @@ -221,8 +235,9 @@ hi! CursorLine ctermbg=236 ctermfg=NONE guibg=#303030 hi! SignColumn ctermbg=NONE guibg=NONE hi! Folded ctermbg=NONE guibg=NONE hi! TabLineFill cterm=None ctermbg=NONE guibg=#080808 guifg=#080808 +hi! TablineSel ctermfg=234 ctermbg=4 guibg=#008bbd guifg=#1c1c1c hi! EndOfBuffer ctermbg=NONE ctermfg=NONE guibg=NONE guifg=#080808 -hi! WildMenu ctermfg=226 ctermbg=0 guifg=#ffff00 guibg=#000000 +hi! WildMenu ctermfg=228 ctermbg=0 guifg=#ffff00 guibg=#000000 hi! link CocErrorSign WarningMsg hi! link CocWarningSign Number hi! link CocInfoSign Type @@ -270,33 +285,69 @@ endfunction function! LinePasteMode() let paste_status = &paste if paste_status == 1 - return " paste " + return ' paste ' else - return "" + return '' endif endfunction function! Statusline() - let b:status="" + let b:status='' let b:status.=ModeColor() let b:status.=CurrentMode() let b:status.=LinePasteMode() - let b:status.="%1* %f " - let b:status.="%1* %m " - let b:status.="%= " - let b:status.="%6*" + let b:status.='%1* ' + let b:status.='%= ' + let b:status.='%6*' let b:status.=LinterStatus() - let b:status.="%3* %p%% ┃ %c " - + let b:status.='%3* %p%% %c ' return b:status endfunction set statusline=%!Statusline() " }}} +" Tabline {{{ +function! Tabline() + let s = '' + for i in range(tabpagenr('$')) + let tab = i + 1 + let winnr = tabpagewinnr(tab) + let buflist = tabpagebuflist(tab) + let bufnr = buflist[winnr - 1] + let bufname = bufname(bufnr) + let bufmodified = getbufvar(bufnr, '&mod') + + let s .= '%' . tab . 'T' + let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#') + let s .= ' ' . tab .':' + let s .= (bufname !=? '' ? '['. fnamemodify(bufname, ':t') . '] ' : '[No Name] ') + + if bufmodified + let s .= '[+] ' + endif + endfor + + let s .= '%#TabLineFill#' + if (exists('g:tablineclosebutton')) + let s .= '%=%999XX' + endif + return s +endfunction +set tabline=%!Tabline() +" }}} " AutoCommands {{{ -if !exists("autocommands_loaded") && has("autocmd") +if !exists('autocommands_loaded') && has('autocmd') let autocommands_loaded = 1 + " Plug updates itself automatically + if empty(glob('~/.config/nvim/autoload/plug.vim')) + silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + aug Plugged + au VimEnter * PlugInstall --sync | source $MYVIMRC + aug END + endif + function! PopOutOfInsertMode() if v:insertmode call feedkeys("\\") @@ -310,7 +361,7 @@ if !exists("autocommands_loaded") && has("autocmd") endfunction function! LocalStatusLine() - let b:status = "%#error#[HELP]%*" + let b:status = '%#error#[HELP]%*' return b:status endfunction @@ -322,7 +373,6 @@ if !exists("autocommands_loaded") && has("autocmd") aug status_line au FileType help setlocal statusline=%!LocalStatusLine() au FileType man setlocal statusline=%!LocalStatusLine() - au FileType fzf setlocal statusline=%!LocalStatusLine() aug END aug on_save @@ -338,14 +388,6 @@ if !exists("autocommands_loaded") && has("autocmd") au QuitPre * if empty(&buftype) | lclose | endif aug END - aug defx_things - " Close defx if it's the only buffer left in the window - au WinEnter * if &ft == 'defx' && winnr('$') == 1 | q | endif - " Move focus to the next window if current buffer is defx - au TabLeave * if &ft == 'defx' | wincmd w | endif - au FileType defx do WinEnter | call s:defx_my_settings() - aug END - aug term_stuff au TermOpen * setlocal nonumber norelativenumber au TermOpen * setlocal laststatus=0 @@ -358,8 +400,9 @@ if !exists("autocommands_loaded") && has("autocmd") aug miscs " Highlight symbol under cursor on CursorHold au CursorHold * silent call CocActionAsync('highlight') - au ColorScheme * call MyHighlights() + au CursorHold * call CocActionAsync('doHover') au User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') + au ColorScheme * call MyHighlights() aug END aug inserts @@ -376,14 +419,6 @@ if !exists("autocommands_loaded") && has("autocmd") aug file_types au FileType * setl formatoptions-=cro - au BufRead,BufNewFile *.md set filetype=markdown - au BufRead,BufNewFile *.txt set filetype=text - au BufRead,BufNewFile *.conf set filetype=config - au BufRead,BufNewFile *.bash* set filetype=sh - au BufRead,BufNewFile *.vue set filetype=vue - au BufRead,BufNewFile *.jsx set filetype=javascript.jsx - au BufRead,BufNewFile *.ts set filetype=typescript - au BufRead,BufNewFile *.tsx set filetype=typescript.tsx au FileType typescript,json setl formatexpr=CocAction('formatSelected') au FileType json syntax match Comment +\/\/.\+$+ aug END @@ -404,7 +439,7 @@ function! LaunchSC() range abort call SetActiveTerminalJobID() call jobsend(g:my_active_terminal_job_id, "scsynth -u 57110\r") sleep 2200ms - silent exe "normal! G" + silent exe 'normal! G' silent exe "normal! :vsplit\n" silent exe "normal! :terminal\n" call SetActiveTerminalJobID() @@ -412,7 +447,7 @@ function! LaunchSC() range abort silent exe "normal! :tabprev\n" silent exe "normal! \n" sleep 2200ms - silent exe "normal! G" + silent exe 'normal! G' endfunction function! LaunchFoxDot() range abort @@ -420,18 +455,18 @@ function! LaunchFoxDot() range abort call jobsend(g:my_active_terminal_job_id, "ipython\r") sleep 2200ms call jobsend(g:my_active_terminal_job_id, "from FoxDot import *\r") - silent exe "normal! G" + silent exe 'normal! G' endfunction function! SetActiveTerminalJobID() let g:my_active_terminal_job_id = b:terminal_job_id - echom "Active terminal job ID set to " . g:my_active_terminal_job_id + echom 'Active terminal job ID set to ' . g:my_active_terminal_job_id endfunction function! LineFlash(blinktime) redraw! exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' - silent exe "normal! vv" + silent exe 'normal! vv' endfunction function! SendToFoxdot() range abort @@ -458,12 +493,8 @@ map xf :set filetype=foxdot "}}} "Mappings {{{ "Normal {{{ -" LaTeX and friends -nnoremap :w! \| !compiler % - " Plug nnoremap pu :PlugUpdate -nnoremap pU :PlugUpgrade nnoremap ¿ G nnoremap gg @@ -472,16 +503,17 @@ nnoremap gg nnoremap ñ ; nnoremap Ñ , -" Super quick search and replace -nnoremap + :'{,'}s/\<=expand("")\>/ -nnoremap ¿ :%s/\<=expand("")\>/ - -" Learn vim keys the hard way +" Resize splits nnoremap :vertical resize -2 nnoremap :vertical resize +2 nnoremap :resize -1 nnoremap :resize +1 -cnoremap jk + +" Maximize current split vertically +nnoremap z + +" Make all splits equal size vertically +nnoremap Z " Edit and source config file nnoremap ev :vsplit $MYVIMRC @@ -497,6 +529,9 @@ nnoremap b :bdelete nnoremap q :q! nnoremap Q :qa! +" Fast leave insert mode +cnoremap jk + " Splits nnoremap T :terminal nnoremap s :split @@ -619,7 +654,7 @@ tnoremap l "}}} " Functions {{{ function! CmdLine(str) - call feedkeys(":" . a:str) + call feedkeys(':' . a:str) endfunction " vp doesn't replace paste buffer diff --git a/.config/zsh/aliases.plugin.zsh b/.config/zsh/aliases.plugin.zsh index 165760c..f43e872 100644 --- a/.config/zsh/aliases.plugin.zsh +++ b/.config/zsh/aliases.plugin.zsh @@ -5,7 +5,7 @@ alias m='neomutt' alias r='ranger' alias amix='alsamixer' alias v='$EDITOR' -alias irc='irssi' +alias irc='weechat' alias play='ncmpcpp' alias torr='transmission-remote-cli' alias cal='calcurse' @@ -24,6 +24,7 @@ alias yt='mpsyt' alias git='lab' alias gst='git status' alias gca='git commit -a -m' +alias gu='git add -vu' alias gc='git add --all && git commit -m' alias gp="git push" @@ -74,7 +75,7 @@ alias pwn='chmod +x' alias ta='tmux attach -t' alias tn='tmux new-session -s' alias tk='tmux kill-session -t' -alias tsq='killall transmission-daemon 2> /dev/null' +alias tsq='kill -9 transmission-daemon' alias tsl='transmission-remote --list' alias tsx='transmission-remote --remove-and-delete -t' alias tsr='transmission-remote --remove -t' \ No newline at end of file diff --git a/.config/zsh/extras.zsh b/.config/zsh/extras.zsh index 3ec0822..36a79bc 100644 --- a/.config/zsh/extras.zsh +++ b/.config/zsh/extras.zsh @@ -1,17 +1,17 @@ # -*- mode: shell-script -*- # vim:ft=zsh - -# Framebuffer colors {{{ -if [ "$TERM" = "linux" ]; then - _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p' - for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do - echo -en "$i" - done - clear - if command -v tmux >/dev/null 2>&1; then - test -z "$TMUX" && (tmux new -A -s shell) - fi +# Tmux {{{ +if command -v tmux >/dev/null 2>&1; then + test -z "$TMUX" && (tmux new -A -s shell) fi +# When you clear the terminal with ctrl-l anything on-screen is not saved (this is compatible with xterm behavior). +# In contrast, GNU screen will first push anything on-screen into the scrollback buffer before clearing the screen. +tmux-clear-screen() { + for line in {1..$(( $LINES ))} ; do echo; done + zle clear-screen +} +zle -N tmux-clear-screen +bindkey "^L" tmux-clear-screen # }}} # Completion Dots {{{ # if you want red dots to be displayed while waiting for completion @@ -48,15 +48,5 @@ ranger() { fi } # }}} -# This is a workaround for tmux {{{ -# When you clear the terminal with ctrl-l anything on-screen is not saved (this is compatible with xterm behavior). -# In contrast, GNU screen will first push anything on-screen into the scrollback buffer before clearing the screen. -tmux-clear-screen() { - for line in {1..$(( $LINES ))} ; do echo; done - zle clear-screen -} -zle -N tmux-clear-screen -bindkey "^L" tmux-clear-screen -# }}} # vim:foldmethod=marker:foldlevel=0 \ No newline at end of file diff --git a/.config/zsh/keys.zsh b/.config/zsh/keys.zsh deleted file mode 100644 index 3615554..0000000 --- a/.config/zsh/keys.zsh +++ /dev/null @@ -1,116 +0,0 @@ -autoload -U history-substring-search-up -autoload -U history-substring-search-down -autoload -U up-line-or-beginning-search -autoload -U down-line-or-beginning-search -zle -N history-substring-search-up -zle -N history-substring-search-down -zle -N up-line-or-beginning-search -zle -N down-line-or-beginning-search - -bindkey -v - -# Fix backspace not working after returning from cmd mode -bindkey '^?' backward-delete-char -bindkey '^h' backward-delete-char -bindkey '^w' backward-kill-word - -# Even more ways to search -bindkey '^P' up-line-or-beginning-search -bindkey '^N' down-line-or-beginning-search -bindkey '^U' history-incremental-pattern-search-backward -bindkey '^F' fzf-history-widget -bindkey -M viins '^K' up-history # ^K to previous command. -bindkey -M viins '^J' down-history # ^J to next command. - -# Ctrl+Y is a standard in some places, and since Ctrl+R is taken... -bindkey -a u undo -bindkey -a '^y' redo - -# file rename magick -bindkey "^[m" copy-prev-shell-word - -# Better searching in command mode -bindkey -M vicmd '?' history-incremental-search-backward -bindkey -M vicmd '/' history-incremental-search-forward -bindkey -M vicmd 'k' history-substring-search-up -bindkey -M vicmd 'j' history-substring-search-down -bindkey -M vicmd '^K' up-history # ^K to previous command. -bindkey -M vicmd '^J' down-history # ^J to next command. -bindkey -M vicmd 'H' vi-beginning-of-line # Go beginning of line. -bindkey -M vicmd 'L' vi-end-of-line # Go end of line. -bindkey -M vicmd 'cr' change-surround # Change surround operator. -bindkey -M vicmd 'dr' delete-surround # Delete surround operator. -bindkey -M vicmd 'yr' add-surround # Add surround operator. - -typeset -g -A key - -key[Home]="$terminfo[khome]" -key[End]="$terminfo[kend]" -key[Insert]="$terminfo[kich1]" -key[Backspace]="$terminfo[kbs]" -key[Delete]="$terminfo[kdch1]" -key[Up]="$terminfo[kcuu1]" -key[Down]="$terminfo[kcud1]" -key[Left]="$terminfo[kcub1]" -key[Right]="$terminfo[kcuf1]" -key[PageUp]="$terminfo[kpp]" -key[PageDown]="$terminfo[knp]" - -# setup key accordingly -[[ -n "$key[Home]" ]] && bindkey -- "$key[Home]" beginning-of-line -[[ -n "$key[End]" ]] && bindkey -- "$key[End]" end-of-line -[[ -n "$key[Insert]" ]] && bindkey -- "$key[Insert]" overwrite-mode -[[ -n "$key[Backspace]" ]] && bindkey -- "$key[Backspace]" backward-delete-char -[[ -n "$key[Delete]" ]] && bindkey -- "$key[Delete]" delete-char -[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" history-substring-search-up -[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" history-substring-search-down -[[ -n "$key[Left]" ]] && bindkey -- "$key[Left]" backward-char -[[ -n "$key[Right]" ]] && bindkey -- "$key[Right]" forward-char -[[ -n "$key[PageUp]" ]] && bindkey -- "$key[PageUp]" history-beginning-search-backward -[[ -n "$key[PageDown]" ]] && bindkey -- "$key[PageDown]" history-beginning-search-forward - -# Runs bindkey but for all of the keymaps. Running it with no arguments will -# print out the mappings for all of the keymaps. -function bindkey-all { - local keymap='' - for keymap in $(bindkey -l); do - [[ "$#" -eq 0 ]] && printf "#### %s\n" "${keymap}" 1>&2 - bindkey -M "${keymap}" "$@" - done -} - -# Finally, make sure the terminal is in application mode, when zle is -# active. Only then are the values from $terminfo valid. -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init () { - echoti smkx - } - function zle-line-finish () { - echoti rmkx - } - zle -N zle-line-init - zle -N zle-line-finish -fi - -# ci" -autoload -U select-quoted -zle -N select-quoted -for m in visual viopp; do - for c in {a,i}{\',\",\`}; do - bindkey -M $m $c select-quoted - done -done - -# ci{, ci(, di{ etc.. -autoload -U select-bracketed -zle -N select-bracketed -for m in visual viopp; do - for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do - bindkey -M $m $c select-bracketed - done -done - -autoload edit-command-line; zle -N edit-command-line -bindkey '^e' edit-command-line - -export KEYTIMEOUT=1 \ No newline at end of file diff --git a/.config/zsh/teclas.zsh b/.config/zsh/teclas.zsh new file mode 100644 index 0000000..4781a73 --- /dev/null +++ b/.config/zsh/teclas.zsh @@ -0,0 +1,100 @@ +# Setup {{{ +foreach carga ( + history-substring-search-up + history-substring-search-down + up-line-or-beginning-search + down-line-or-beginning-search + surround + select-bracketed + select-quoted +) { + autoload -U $carga +} +foreach widge ( + history-substring-search-up + history-substring-search-down + up-line-or-beginning-search + down-line-or-beginning-search + delete-surround surround + add-surround surround + change-surround surround + select-bracketed + select-quoted +) { + zle -N $widge +} + +bindkey -v + +typeset -g -A key + +key[Home]="$terminfo[khome]" +key[End]="$terminfo[kend]" +key[Insert]="$terminfo[kich1]" +key[Backspace]="$terminfo[kbs]" +key[Delete]="$terminfo[kdch1]" +key[Up]="$terminfo[kcuu1]" +key[Down]="$terminfo[kcud1]" +key[Left]="$terminfo[kcub1]" +key[Right]="$terminfo[kcuf1]" +key[PageUp]="$terminfo[kpp]" +key[PageDown]="$terminfo[knp]" +# }}} +# Insert {{{ +bindkey -M viins '^K' up-history # ^K to previous command. +bindkey -M viins '^J' down-history # ^J to next command. +bindkey -M viins '^F' vi-forward-char # Go forward char or complete current completion. +bindkey -M viins '^B' backward-kill-word # Delete a WORD backward. +bindkey -M viins '^Y' redo +bindkey -M viins '^P' up-line-or-beginning-search +bindkey -M viins '^N' down-line-or-beginning-search +bindkey -M viins '^U' history-incremental-pattern-search-backward +#bindkey -M viins '^?' backward-delete-char # Delete left char with backspace key. +#bindkey -M viins '^[[3~' delete-char # Ensure delete key always delete forward. +bindkey -M viins '^[[A' history-substring-search-up +bindkey -M viins '^[[B' history-substring-search-down + +[[ -n "$key[Home]" ]] && bindkey -M viins -- "$key[Home]" beginning-of-line +[[ -n "$key[End]" ]] && bindkey -M viins -- "$key[End]" end-of-line +[[ -n "$key[Insert]" ]] && bindkey -M viins -- "$key[Insert]" overwrite-mode +[[ -n "$key[Backspace]" ]] && bindkey -M viins -- "$key[Backspace]" backward-delete-char +[[ -n "$key[Delete]" ]] && bindkey -M viins -- "$key[Delete]" delete-char +[[ -n "$key[Up]" ]] && bindkey -M viins -- "$key[Up]" history-substring-search-up +[[ -n "$key[Down]" ]] && bindkey -M viins -- "$key[Down]" history-substring-search-down +[[ -n "$key[Left]" ]] && bindkey -M viins -- "$key[Left]" backward-char +[[ -n "$key[Right]" ]] && bindkey -M viins -- "$key[Right]" forward-char +[[ -n "$key[PageUp]" ]] && bindkey -M viins -- "$key[PageUp]" history-beginning-search-backward +[[ -n "$key[PageDown]" ]] && bindkey -M viins -- "$key[PageDown]" history-beginning-search-forward +# }}} +# Normal {{{ +bindkey -M vicmd 'j' down-line # Override down-line-or-history. +bindkey -M vicmd 'k' up-line # Override up-line-or-history. +bindkey -M vicmd '^K' up-history # ^K to previous command. +bindkey -M vicmd '^J' down-history # ^J to next command. +bindkey -M vicmd 'H' vi-beginning-of-line # Go beginning of line. +bindkey -M vicmd 'L' vi-end-of-line # Go end of line. +bindkey -M vicmd 'cs' change-surround # Change surround operator. +bindkey -M vicmd 'ds' delete-surround # Delete surround operator. +bindkey -M vicmd 'ys' add-surround # Add surround operator. +bindkey -M vicmd '?' history-incremental-search-backward +bindkey -M vicmd '/' history-incremental-search-forward +bindkey -M vicmd '^Y' redo +bindkey -M vicmd '^[[A' history-substring-search-up +bindkey -M vicmd '^[[B' history-substring-search-down +# }}} +# Visual {{{ +bindkey -M visual 'H' vi-beginning-of-line # Go beginning of line. +bindkey -M visual 'L' vi-end-of-line # Go end of line. +bindkey -M visual 'S' add-surround # Add surround. +foreach char ({a,i}{\',\",\`}) { bindkey -M visual $char select-quoted } && unset char # Text objects for delimiters. +foreach char ({a,i}${(s..)^:-'()[]{}<>bB'}) { bindkey -M visual $char select-bracketed } && unset char # Text objects for pairs of brackets. +# }}} +# Operator {{{ +bindkey -M viopp 'H' vi-beginning-of-line # Go beginning of line. +bindkey -M viopp 'L' vi-end-of-line # Go end of line. +foreach char ({a,i}{\',\",\`}) { bindkey -M viopp $char select-quoted } && unset char # Text objects for delimiters. +foreach char ({a,i}${(s..)^:-'()[]{}<>bB'}) { bindkey -M viopp $char select-bracketed } && unset char # Text objects for pairs of brackets. + +export KEYTIMEOUT=1 +# }}} +# vim:foldmethod=marker:foldlevel=0 diff --git a/.mozilla/firefox/o67v3l1t.default-1513624824943/chrome/userChrome.css b/.mozilla/firefox/o67v3l1t.default-1513624824943/chrome/userChrome.css index bf0c5a1..93ba57d 100644 --- a/.mozilla/firefox/o67v3l1t.default-1513624824943/chrome/userChrome.css +++ b/.mozilla/firefox/o67v3l1t.default-1513624824943/chrome/userChrome.css @@ -47,12 +47,6 @@ textbox { border: none !important; } -vbox[style], -hbox[style] { - background-color: #212121 !important; - border: none !important; -} - window#main-window { --tabs-navbar-shadow-size: 0px !important; --chrome-content-separator-color: none !important; diff --git a/.tmux.conf b/.tmux.conf index 225e4a4..5932bb6 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -68,7 +68,6 @@ set -g prefix M-a bind-key M-a send-prefix # Varios -bind-key ? list-keys bind-key D detach-client bind-key : command-prompt bind-key R respawn-window @@ -108,18 +107,6 @@ bind-key X kill-window bind-key Z kill-session bind-key Q kill-server -# Ir a ventana -bind-key 1 select-window -t :1 -bind-key 2 select-window -t :2 -bind-key 3 select-window -t :3 -bind-key 4 select-window -t :4 -bind-key 5 select-window -t :5 -bind-key 6 select-window -t :6 -bind-key 7 select-window -t :7 -bind-key 8 select-window -t :8 -bind-key 9 select-window -t :9 -bind-key 0 select-window -t :0 - # Movimiento de ventanas bind-key -n C-left prev bind-key -n C-right next @@ -132,9 +119,6 @@ bind-key w choose-tree -Zw "swap-window -t '%%'" bind-key s choose-tree -Zw "swap-pane -t '%%'" bind-key m choose-tree -Zw "move-pane -t '%%'" -# Urlscan -bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlscan" '$SHELL -c "urlscan < /tmp/tmux-buffer"' - # Copy/paste. Seleccionar texto con el mouse lo copia automaticamente al clipboard bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i -p -b" bind-key -n M-S-v run "xsel -o | tmux load-buffer - ; tmux paste-buffer"