From d163ca7a19458aefb950ca68d6e66cd0dae7203e Mon Sep 17 00:00:00 2001 From: clint Date: Sun, 9 Oct 2022 23:44:00 -0500 Subject: [PATCH] nvim stuff and tmux --- nvim/.config/nvim/ftplugin/python.lua | 2 +- nvim/.config/nvim/lua/keybindings.lua | 4 ++ nvim/.config/nvim/lua/plugins.lua | 6 +++ nvim/.config/nvim/lua/settings.lua | 6 +++ picom/.config/picom/picom.conf | 8 ++++ tmux/.tmux.conf | 32 +++++++++++++++ vim/.vim/after/ftplugin/python.vim | 2 +- vimrc/.vimrc | 57 +++++++++++++++++++++------ 8 files changed, 104 insertions(+), 13 deletions(-) create mode 100644 tmux/.tmux.conf diff --git a/nvim/.config/nvim/ftplugin/python.lua b/nvim/.config/nvim/ftplugin/python.lua index 7c7efe4..d461f16 100644 --- a/nvim/.config/nvim/ftplugin/python.lua +++ b/nvim/.config/nvim/ftplugin/python.lua @@ -11,4 +11,4 @@ keymap('n', '', ":w:exec '!clear;python' shellescape(@%, 1)", defaul -- Handy stuff keymap('n', 'm', 'iif __name__ == "__main__":omain()o', default_ops) -keymap('n', 'f', 'idef ():bi', default_ops) +-- keymap('n', 'f', 'idef ():bi', default_ops) diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index 5a6d6f1..231e95e 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -9,6 +9,10 @@ keymap('n', '', ':wq', default_ops) keymap('n', '[b', ':bp', default_ops) keymap('n', ']b', ':bn', default_ops) +-- Enter lines +keymap('n', '', 'o', default_ops) +keymap('n', '', 'O', default_ops) + -- Folding keymap('n', '', 'za', default_ops) -- keymap('n', '', 'za', default_ops) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 7e141dd..61a1e8f 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -34,5 +34,11 @@ return require('packer').startup(function(use) use('ncm2/ncm2-path') -- Path completion use('ncm2/ncm2-jedi') -- Python completion + -- Slime, for tmux repl-ing + use('jpalardy/vim-slime') + + -- Telescope, fuzzy finding + use('nvim-lua/plenary.nvim') + use('nvim-telescope/telescope.nvim') end) diff --git a/nvim/.config/nvim/lua/settings.lua b/nvim/.config/nvim/lua/settings.lua index 220f83e..c9480a0 100644 --- a/nvim/.config/nvim/lua/settings.lua +++ b/nvim/.config/nvim/lua/settings.lua @@ -21,3 +21,9 @@ settings.foldmethod = "indent" settings.foldnestmax = 99 settings.foldlevelstart = 99 +-- slime +vim.g.slime_target = 'tmux' +vim.g.slime_default_config = { + socket_name = vim.api.nvim_eval('get(split($TMUX, ","), 0)'), + target_pane = '{bottom}', +} diff --git a/picom/.config/picom/picom.conf b/picom/.config/picom/picom.conf index 6552290..e1fbea5 100644 --- a/picom/.config/picom/picom.conf +++ b/picom/.config/picom/picom.conf @@ -157,6 +157,14 @@ opacity-rule = [ "10:class_g = 'alacritty'"]; # Background-Blurring # ################################# +experimental-backend = true; + +blur: { + method = "dual_kawase"; + strength = 10; + blur-background = true; +}; + # Parameters for background blurring, see the *BLUR* section for more information. # blur-method = diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..35cbd86 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,32 @@ +# remap prefix from 'C-b' to 'C-a' +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# 0 is too far from Ctrl-a. +set -g base-index 1 + +# 1-indexed panes to match the windows. +setw -g pane-base-index 1 + +# Look nice. +set -g default-terminal screen-256color + +# split panes using | and - +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % + +# reload config file (change file location to your the tmux.conf you want to use) +bind r source-file ~/.tmux.conf\; display ' Reloaded tmux config.' + +# switch panes using Alt-arrow without prefix +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Shift + arrow key to move between windows. +bind-key -n S-Left previous-window +bind-key -n S-Right next-window diff --git a/vim/.vim/after/ftplugin/python.vim b/vim/.vim/after/ftplugin/python.vim index 6943d50..fdc4df3 100644 --- a/vim/.vim/after/ftplugin/python.vim +++ b/vim/.vim/after/ftplugin/python.vim @@ -4,7 +4,7 @@ set shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent smartindent " Right-most border set colorcolumn=80 -setlocal path=.,** +" setlocal path=.,** setlocal wildignore=*.pyc " if name equals main diff --git a/vimrc/.vimrc b/vimrc/.vimrc index ebc446b..80e654f 100644 --- a/vimrc/.vimrc +++ b/vimrc/.vimrc @@ -23,14 +23,44 @@ let $RC="$HOME/.vimrc" set path=.,** " Plugin stuff -execute pathogen#infect() +call plug#begin() +" Colors and stuff +Plug 'vim-airline/vim-airline' +Plug 'dikiaap/minimalist' +Plug 'jacoborus/tender.vim' +Plug 'jpo/vim-railscasts-theme' +Plug 'rainux/vim-desert-warm-256' +Plug 'morhetz/gruvbox' +Plug 'ayu-theme/ayu-vim' +" NerdTree stuff +Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' } +Plug 'Xuyuanp/nerdtree-git-plugin' +Plug 'ryanoasis/vim-devicons' +Plug 'ervandew/supertab' +" Auto-complete: +Plug 'ncm2/ncm2' +Plug 'roxma/nvim-yarp' +" enable ncm2 for all buffers +autocmd BufEnter * call ncm2#enable_for_buffer() +" IMPORTANT: :help Ncm2PopupOpen for more information +set completeopt=noinsert,menuone,noselect +" NOTE: you need to install completion sources to get completions. Check +" our wiki page for a list of sources: https://github.com/ncm2/ncm2/wiki +Plug 'ncm2/ncm2-bufword' +Plug 'ncm2/ncm2-path' +Plug 'ncm2/ncm2-jedi' +call plug#end() + +" Supertab +let g:SuperTabMappingForward = '' +let g:SuperTabMappingBackward = '' " Always show file name set laststatus=2 " Enter to insert blank line below current, Shift+Enter to insert above map o -map O +map O " Folding (move to python specific vim file?) set foldmethod=indent @@ -40,8 +70,8 @@ nnoremap za vnoremap zf " F9 execute current Python file -autocmd FileType python map :w:exec '!clear;python' shellescape(@%, 1) -autocmd FileType python imap :w:exec '!clear;python' shellescape(@%, 1) +autocmd FileType python map :w:exec '!clear;python' shellescape(@%, 1) +autocmd FileType python imap :w:exec '!clear;python' shellescape(@%, 1) " Cycle through buffers map [b :bp @@ -55,7 +85,6 @@ map :NERDTreeToggle map :w map :wq - " Lint autocmd FileType python map gl :w:exec '!python -m black' shellescape(@%, 1) @@ -65,19 +94,25 @@ autocmd VimEnter * NERDTree | wincmd p " Exit Vim if NERDTree is the only window remaining in the only tab. autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif - " If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree. autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif -" Open the existing NERDTree on each new tab. -autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif - " Show hidden let NERDTreeShowHidden=1 - +" Color schemes " colorscheme moonfly " colorscheme onenord -" colorscheme gruvbox-baby +" colorscheme gruvbox +set background=dark +colorscheme ayu +set termguicolors +let ayucolor="dark" " colorscheme tender +" colorscheme railscasts +" colorscheme desert-warm-256 + +" Restore transparent background +" highlight Normal guibg=none +" highlight NonText guibg=none