February update

This commit is contained in:
Augusto Gunsch 2022-02-06 14:48:48 -03:00
parent 71a7fe2b72
commit af39225ac2
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
6 changed files with 51 additions and 26 deletions

View File

@ -17,8 +17,8 @@ macro f set browser "feh %u"
macro m set browser "mpv %u"
macro M set browser "mpv %u" ; open-in-browser ; set browser "qutebrowser %u"
macro q set browser "qutebrowser %u"
macro d set browser "youtube-dl -f best -o '~/videos/%(title)s.%(ext)s' '%u'"
macro D set browser "youtube-dl -f best -o '~/videos/%(title)s.%(ext)s' '%u'" ; open-in-browser ; set browser "qutebrowser %u"
macro d set browser "yt-dlp -f best -o '~/videos/%(title)s.%(ext)s' '%u'"
macro D set browser "yt-dlp -f best -o '~/videos/%(title)s.%(ext)s' '%u'" ; open-in-browser ; set browser "qutebrowser %u"
macro y set browser "echo -n %u | xclip -sel clip" ; open-in-browser ; set browser "qutebrowser %u"
unbind-key l

View File

@ -7,6 +7,7 @@ set nu rnu
set smartindent
set nocp
set bo=all
set mouse=a
colorscheme torte
set list
set listchars=tab:*·,lead,trail:~,extends:>,precedes:<
@ -30,6 +31,8 @@ nnoremap <silent> <F2> <cmd>ToggleDiagOff<cr>:Gdiffsplit<cr>
nnoremap <silent> <F5> <cmd>ToggleDiag<cr>
nnoremap <silent> <F6> <cmd>%!expand -t4<cr><cmd>%!sed 's/[ \t]*$//'<cr>
nnoremap <silent> <F7> <cmd>%!unexpand -t4<cr><cmd>%!sed 's/[ \t]*$//'<cr>
nnoremap <silent> <F8> <cmd>TagbarToggle<CR>
nnoremap <silent> <C-n> <cmd>NERDTreeToggle<CR>
noremap - ddp
nnoremap _ ddkP
@ -64,9 +67,11 @@ Plug 'drmingdrmer/xptemplate'
Plug 'WhoIsSethDaniel/toggle-lsp-diagnostics.nvim'
call plug#end()
Plug 'preservim/tagbar'
nnoremap <C-n> <cmd>silent NERDTreeToggle<CR>
Plug 'junegunn/fzf.vim'
call plug#end()
augroup python
autocmd FileType python :iabbrev <buffer> frompdb from pdb import set_trace; set_trace()
@ -111,9 +116,14 @@ vim.api.nvim_set_keymap('i', '<cr>', 'compe#confirm("<cr>")', { expr = true })
local common_bindings = function(client, bufnr)
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local opts = { noremap=true, silent=true }
--Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
buf_set_keymap('n', '<C-[>', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
end
local default_formatting = function(client, bufnr)
@ -144,27 +154,10 @@ end
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'clangd', 'rls', 'tsserver' }
local servers = { 'clangd', 'rls', 'tsserver', 'jedi_language_server' }
for _, lsp in ipairs(servers) do
setup(lsp, default_attach)
end
-- Servers with custom setup
-- pylsp
local pylsp_settings = {
pylsp = {
plugins = {
pycodestyle = {
enabled = true,
ignore = {'E501', 'E711'}
}
}
}
}
setup('pylsp', default_attach, pylsp_settings)
EOF
" auto close scratch buffer (preview window)

View File

@ -27,7 +27,6 @@ alias feh="feh -."
# vi keybindings
alias info="info --vi-keys"
alias less="less -R"
alias find="find -name"
alias sl="ls"
alias la="ls -a"
alias venv="source venv/bin/activate"
@ -46,4 +45,7 @@ goto() {
}
# NVM - Dynamic loading trick
alias nvm="unalias nvm && source /usr/share/nvm/init-nvm.sh && nvm"
alias nvm="unalias nvm && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; nvm"
alias node="unalias node && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; node"
source "$HOME/.swallow"

22
home/swallow Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
MPV=/usr/bin/mpv
mpv() {
EXT=${*##*.}
case "$*" in
*--no-video*)
$MPV $*
;;
*)
case "$EXT" in
ogg|opus|mp3)
$MPV $*
;;
*)
swallow $MPV $*
;;
esac
;;
esac
}

View File

@ -58,8 +58,8 @@ set -g pane-active-border-style 'bg=colour0 fg=colour9'
set -g status-position bottom
set -g status-justify left
set -g status-style 'bg=colour234 fg=colour255'
set -g status-left '#[fg=colour255,bg=colour234]  '
set -g status-right '#[bg=colour234,fg=colour27]#[fg=colour255,bg=colour27]  %d/%m  %H:%M '
set -g status-left '#[fg=colour255,bg=colour234]  '
set -g status-right '#[bg=colour234,fg=colour27]#[fg=colour255,bg=colour27]  %d/%m  %H:%M '
set -g status-right-length 50
set -g status-left-length 20

8
local/bin/swallow Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
CMD="$1"
shift 1
WINDOW=$(xdotool getwindowfocus)
xdotool windowunmap "$WINDOW"
$CMD "$@" > /dev/null 2>&1
xdotool windowmap "$WINDOW"