From 3b95857d2d5f46c7096743a379e4696f6982ac6c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 18 May 2024 18:55:59 -0700 Subject: [PATCH] renames --- .tmux.conf | 131 ------- .vimrc | 1116 --------------------------------------------------------- .yarnrc | 6 - dot_tmux.conf | 131 +++++++ dot_vimrc | 1116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ dot_yarnrc | 6 + 6 files changed, 1253 insertions(+), 1253 deletions(-) delete mode 100644 .tmux.conf delete mode 100644 .vimrc delete mode 100644 .yarnrc create mode 100644 dot_tmux.conf create mode 100644 dot_vimrc create mode 100644 dot_yarnrc diff --git a/.tmux.conf b/.tmux.conf deleted file mode 100644 index b3542e5..0000000 --- a/.tmux.conf +++ /dev/null @@ -1,131 +0,0 @@ -set -g prefix C-a -unbind C-b - -set -g base-index 1 -setw -g pane-base-index 1 - -# Make vim more responsive -set -sg escape-time 10 - -bind-key C-o last-window -bind-key C-a select-pane -t :.+ -bind-key a send-prefix -bind r source-file ~/.tmux.conf -bind -n M-j select-pane -D -bind -n M-k select-pane -U -bind -n M-h select-pane -L -bind -n M-l select-pane -R -bind -n M-n next-window -bind -n M-p previous-window -bind-key C-n next-window -bind-key C-p previous-window -set -g set-titles off -set -g mouse on -set -g default-terminal tmux-256color -set-option -g default-shell /bin/fish -setw -g mode-keys vi -new -d - - -# shift-movement keys will resize panes -bind -r H resize-pane -L 5 -bind -r J resize-pane -D 5 -bind -r K resize-pane -U 5 -bind -r L resize-pane -R 5 - -# better mnemonics for splitting panes! -#bind | split-window -h -#bind - split-window -v - -bind-key h select-pane -L -bind-key k select-pane -U -bind-key j select-pane -D -bind-key l select-pane -R - -bind-key u break-pane -#bind-key sdf command-prompt -p "join pane from:" "join-pane -s '%%'" -bind-key y command-prompt -p "send pane to:" "join-pane -t :'%%' \; select-layout main-vertical" -bind-key Enter rotate-window - -bind v split-window -h -bind = select-layout even-horizontal -bind | select-layout main-vertical -bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`" - -# Status Bar -##set -g status-bg black -set -g status-interval 5 -##set -g status-left '#[fg=green]#H#[default]' -##set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' -#set -g status-justify centre # center align window list -#set -g status-style fg=white,bg=default - -## default window title colors -#set-window-option -g window-status-style fg=white,bg=default,dim - -## active window title colors -#set -g main-pane-width 68% -#set-window-option -g window-status-current-style fg=cyan,bg=default,bright - -#set-window-option -g window-style fg=#999999,bg=terminal -#set-window-option -g window-active-style fg=terminal,bg=terminal - -#set -g status-left '#[fg=green][ #h ][' -#set -g status-left-length 40 -#set -g status-right '#[fg=green]][#(battery) #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' -#set -g status-right-length 40 -set-window-option -g window-status-activity-style none -# Notifying if other windows has activities -set -g monitor-activity on -set -g visual-activity off -set -g visual-bell on -set -g bell-action none -set -g activity-action none - -# Highlighting the active window in status bar -#setw -g window-status-current-style bg=red,bright -set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha - -set -g @catppuccin_window_status_enable "yes" -set -g @catppuccin_window_number_position "left" -set -g @catppuccin_window_left_separator "" -set -g @catppuccin_window_right_separator " " -set -g @catppuccin_window_middle_separator " " -set -g @catppuccin_window_connect_separator "yes" - -set -g @catppuccin_window_default_color "#{thm_gray}" -set -g @catppuccin_window_default_background "#{thm_green}" -set -g @catppuccin_window_default_fill "all" -set -g @catppuccin_window_default_text "#W" - -set -g @catppuccin_window_current_fill "all" -set -g @catppuccin_window_current_text "#W" -set -g @catppuccin_window_current_color "#{thm_blue}" -set -g @catppuccin_window_current_background "#{thm_bg}" - -set -g @catppuccin_icon_window_last "󰖰" -set -g @catppuccin_icon_window_current "󰫣" -set -g @catppuccin_icon_window_zoom "󰁌" -set -g @catppuccin_icon_window_mark "󰃀" -set -g @catppuccin_icon_window_silent "󰂛" -set -g @catppuccin_icon_window_activity "󱅫" -set -g @catppuccin_icon_window_bell "󰂞" - -set -g @catppuccin_status_modules_right "directory battery host date_time" -set -g @catppuccin_status_left_separator "" -set -g @catppuccin_status_right_separator "" -set -g @catppuccin_status_fill "icon" -set -g @catppuccin_status_connect_separator "yes" -set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M" - -set -g @catppuccin_pane_status_enabled "yes" - - -set -g @catppuccin_directory_text "#{pane_current_path}" -set -g @plugin 'catppuccin/tmux' - - -set -g @plugin 'tmux-plugins/tmux-battery' -set -g @plugin 'tmux-plugins/tpm' -run -b '~/.tmux/plugins/tpm/tpm' -# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm diff --git a/.vimrc b/.vimrc deleted file mode 100644 index 3ba9369..0000000 --- a/.vimrc +++ /dev/null @@ -1,1116 +0,0 @@ -" ___ _ _ _ -" | _ ) __ _ _ _ __ _| |_( )___ __ _(_)_ __ _ _ __ -" | _ \/ _` | '_/ _` | / //(_-< \ V / | ' \| '_/ _| -" |___/\__,_|_| \__,_|_\_\ /__/ (_)_/|_|_|_|_|_| \__| -" -" -" ** BASIC EDITOR SETTINGS ** -" -" First, we are vim, not vi, so start as many others do with -set nocompatible - -" Allow background buffers. Super important for various tab modes. -set hidden - -" Set default spacing. -" Hard tabs should show as 8. -set ts=8 -" Soft tabs should be 2 wide, and we should use spaces. -" (This is the Googler in me. I've converted to spaces over -" the years because it really is more consistent.) -set softtabstop=2 -set shiftwidth=2 -set expandtab -" I like comma instead of slash, but that probably comes from playing -" Nethack and Angband -let mapleader = "," -let maplocalleader = "\\" - -" Set 'smart' things in Vim -" Search case insensitive, unless it contains Uppercase letters -set smartcase -" Use all the indent features -set autoindent -set smartindent -set cindent -" Make backspace remove indents and line breaks, like a normal editor -set backspace=indent,eol,start - -" Keep a bigger history -set history=1000 -" Allow tab completion for files in command mode. -set wildmenu -set wildmode=list:longest -" Show where you are in the file in the statusbar. -set ruler - -" I hate split above, so make it split below. Likewise, to the right. -set splitbelow -" For autocomplete, follow requirements for nvim-compe -set completeopt=menuone,noselect -set signcolumn=yes -set shortmess+=c - -set diffopt+=vertical -" Some stuff for 256-Color consoles that I've forgotten. -set t_Co=256 -set t_Sf=ESC[3%dm -set t_Sb=ESC[4%dm -set t_ut= -"set t_SH= -"set t_kb= - -" This is like HiglightTooLongLines below, but for modern vim. The problem is -" that it highlights the column, even if your short. Good for measuring, bad for -" my eyes. -"if v:version >= 703 - "set relativenumber - "set colorcolumn=81 -"endif -" ** PATH SETTINGS ** - -let g:loaded_python_provider = 0 -let $RUST_SRC_PATH="/usr/src/rust/src/" - -"let g:ft_ignore_pat = '.org' -" - -if exists('veonim') - let g:vscode_extensions = [ - \'ms-python.python', - \'ms-vscode.go', - \] - set guifont=Droid\ Sans\ Mono\ Dotted:h20 -" set linespace=10 -endif - -if exists('g:neovide') - let g:neovide_floating_blur_amount_x = 2.0 - let g:neovide_floating_blur_amount_y = 2.0 - let g:neovide_transparency = 0.95 - let g:neovide_scroll_animation_length = 0.1 - let g:neovide_cursor_animation_length = 0.05 - let g:neovide_cursor_trail_size = 0.5 -endif - - -" * Polyglot - -let g:tex_flavor = 'latex' -let g:polyglot_disabled = ['latex'] -let g:powerline_loaded = 1 - - -" Required: -set runtimepath+=$HOME/.vim/bundle/repos/github.com/Shougo/dein.vim - -" Required: -call plug#begin($HOME . '/.vim/bundle') - -" Plugins that must be first -Plug $HOME . '/.vim/bundle/repos/github.com/Shougo/dein.vim' -Plug 'let-def/vimbufsync' -Plug 'lambdalisue/suda.vim' -Plug 'skywind3000/asyncrun.vim' -Plug 'barakmich/vim-code-dark' - -" Plugins that I almost never use -"Plug 'vim-scripts/DrawIt' -"Plug 'vim-scripts/EasyGrep' -Plug 'chrisbra/NrrwRgn' -"Plug 'mattn/calendar-vim' -"Plug 'rstacruz/sparkup' -"Plug 'tristen/vim-sparkup' -"Plug 'tpope/vim-fireplace', {'for': 'clojure'} -""Plug 'terryma/vim-multiple-cursors' -"Plug 'ambv/black' -Plug 'kana/vim-textobj-user' - - -" Plugins I wish I used more -"Plug 'hsitz/VimOrganizer' -Plug 'jceb/vim-orgmode' -Plug 'tpope/vim-speeddating' - -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-unimpaired' -Plug 'b4winckler/vim-angry' -Plug 'tpope/vim-surround' -Plug 'junegunn/vim-easy-align' -Plug 'bps/vim-textobj-python' - -" Plugins I NEED -Plug 'scrooloose/nerdcommenter' -Plug 'sjbach/lusty' -"Plug 'w0rp/ale' -"Plug 'airblade/vim-gitgutter' -Plug 'mhinz/vim-signify' -"Plug 'vim-airline/vim-airline' -"Plug 'vim-airline/vim-airline-themes' -Plug 'nvim-lualine/lualine.nvim' -Plug 'linrongbin16/lsp-progress.nvim' -"Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -"Plug 'junegunn/fzf.vim' -Plug 'airblade/vim-rooter' -"Plug 'bling/vim-bufferline' -Plug 'majutsushi/tagbar' -"Plug 'SirVer/ultisnips' -Plug 'dcampos/nvim-snippy' -Plug 'rafamadriz/friendly-snippets' - -Plug 'honza/vim-snippets' -"Plug 'fatih/vim-go' -Plug 'tpope/vim-abolish' -"Plug 'sheerun/vim-polyglot' -Plug 'Shougo/denite.nvim' -"Plug 'plytophogy/vim-virtualenv' -"Plug 'ervandew/supertab' -"Plug 'ncm2/ncm2' -"Plug 'roxma/nvim-yarp' - - -" Plugins I NEEDED -"Plug 'scrooloose/nerdtree' -"Plug 'scrooloose/syntastic' -"Plug 'Valloric/YouCompleteMe' -"Plug 'vim-scripts/fish-syntax' -"Plug 'kchmck/vim-coffee-script' -"Plug 'rodjek/vim-puppet' -"Plug 'JuliaLang/julia-vim' -"Plug 'rust-lang/rust.vim' -"Plug 'hashivim/vim-terraform' -"Plug 'HerringtonDarkholme/yats.vim' -"Plug 'kien/ctrlp.vim' -"Plug 'farseer90718/vim-taskwarrior' -"Plug 't-yuki/vim-go-coverlay' - -" Plugins for syntax -Plug 'lunaru/vim-less' -Plug 'hylang/vim-hy', {'for': 'hy'} -Plug 'jneen/ragel.vim' -Plug 'NoahTheDuke/vim-just' -"Plug 'mhartington/nvim-typescript' -"Plug 'leafgarland/typescript-vim' -Plug 'leafOfTree/vim-svelte-plugin' -"Plug 'posva/vim-vue' -Plug 'Shougo/context_filetype.vim' -"Plug 'idris-hackers/idris-vim', {'for': 'idris'} -Plug 'fedorenchik/AnsiEsc' -Plug 'hwayne/tla.vim' -Plug 'zchee/vim-goasm' -Plug 'cappyzawa/starlark.vim' - -" Plugins that autocomplete -"Plug 'Shougo/deoplete.nvim' -"Plug 'zchee/deoplete-clang' -"Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}} -"Plug 'zchee/deoplete-jedi' -"Plug 'davidhalter/jedi-vim' -"Plug 'eagletmt/neco-ghc', {'for': 'haskell'} -"Plug 'eagletmt/ghcmod-vim', {'for': 'haskell'} -"Plug 'racer-rust/vim-racer', {'for': 'rust'} -"Plug 'autozimu/LanguageClient-neovim', { - "\ 'branch': 'next', - "\ 'do': 'bash install.sh', - "\ } -"Plug 'ensime/ensime-vim', { 'do': ':UpdateRemotePlugins' } -"Plug 'neoclide/coc.nvim', {'branch': 'release'} -"Plug 'romainl/vim-qf' -Plug 'neovim/nvim-lspconfig' -Plug 'nvim-lua/lsp_extensions.nvim' -Plug 'hrsh7th/nvim-compe' -"Plug 'nvim-lua/completion-nvim' -Plug 'onsails/lspkind-nvim' - -Plug 'nvim-lua/popup.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'nvim-telescope/telescope.nvim' -Plug 'sindrets/diffview.nvim' - -Plug 'kyazdani42/nvim-web-devicons' " for file icons -"Plug 'kyazdani42/nvim-tree.lua' - -Plug 'ray-x/lsp_signature.nvim' -Plug 'ray-x/go.nvim' - -Plug 'RishabhRD/popfix' -Plug 'RishabhRD/nvim-lsputils' -Plug 'stevanmilic/nvim-lspimport' -Plug 'folke/trouble.nvim' -Plug 'creativenull/efmls-configs-nvim', { 'tag': 'v1.*' } - -" Plugins that do specific things -"Plug 'Shougo/vimproc.vim' -"Plug 'Shougo/vimfiler.vim' - -Plug 'tamago324/lir.nvim' - -Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} -Plug 'nvim-treesitter/playground' -Plug 'nvim-treesitter/nvim-treesitter-textobjects' - - -"Plug 'ggandor/lightspeed.nvim' -"Plug 'justinmk/vim-sneak' -Plug 'ggandor/leap.nvim' -Plug 'ggandor/flit.nvim' -Plug 'simrat39/rust-tools.nvim' - -Plug 'Shougo/unite.vim' -" TODO: Look into Coqtail, same author -Plug 'whonore/coquille', {'branch': 'pathogen-bundle', 'for': 'coq'} -"Plug 'dhruvasagar/vim-zoom' -Plug 'gabrielelana/vim-markdown' -Plug 'lervag/vimtex' -Plug 'Shougo/echodoc.vim' -"Plug 'python-rope/ropevim' -Plug 'windwp/nvim-autopairs' -Plug 'danymat/neogen' - -" Unclear -"Plug 'ncm2/float-preview.nvim' -Plug 'lambdalisue/gina.vim' -Plug 'edolphin-ydf/goimpl.nvim' - -call plug#end() - -filetype plugin indent on -syntax enable - -" enable ncm2 for all buffers -"autocmd BufEnter * call ncm2#enable_for_buffer() - - -" **** Configure LSP - -luafile $HOME/.vim/nvim.lua - - -" Code navigation shortcuts -nnoremap gd lua vim.lsp.buf.definition() -nnoremap gi lua vim.lsp.buf.implementation() -nnoremap gy lua vim.lsp.buf.type_definition() -nnoremap K lua vim.lsp.buf.hover() -nnoremap gs lua vim.lsp.buf.signature_help() -nnoremap gR lua vim.lsp.buf.rename() -"nnoremap gr lua vim.lsp.buf.references() -nnoremap gr lua require('telescope.builtin').lsp_references({initial_mode = "normal"}) -nnoremap g0 lua vim.lsp.buf.document_symbol() -nnoremap gW lua vim.lsp.buf.workspace_symbol() -"nnoremap gd lua vim.lsp.buf.declaration() -nnoremap ga lua vim.lsp.buf.code_action() -"nnoremap ga lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"}) -vnoremap ga lua vim.lsp.buf.code_action() -"vnoremap ga :lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"}) -"nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) -"nnoremap ge lua vim.diagnostic.open_float({focusable = false}) - -nnoremap xx TroubleToggle -nnoremap xq lua vim.diagnostic.setqflist() -"nnoremap nc lua neogen_dwim() -nnoremap nc lua require('neogen').generate({ type = 'any' }) -nnoremap gm lua require('lspimport').import() - - -" Set updatetime for CursorHold -" 300ms of no cursor movement to trigger CursorHold -set updatetime=500 -" Show diagnostic popup on cursor hold -autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) - -" Autoformat on save -autocmd BufWritePre *.lua lua vim.lsp.buf.format({ async = false }) -autocmd BufWritePre *.py lua vim.lsp.buf.format({ async = false }) -autocmd BufWritePre *.rs lua vim.lsp.buf.format({ async = false }) -autocmd BufWritePre *.go lua vim.lsp.buf.format({ async = false }) -autocmd BufWritePre *.go silent! lua org_imports(3000) -autocmd BufWritePre *.ts lua vim.lsp.buf.format({ async = false }) - -" Goto previous/next diagnostic warning/error -nnoremap g[ lua vim.diagnostic.goto_prev() -nnoremap g] lua vim.diagnostic.goto_next() - -let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] -let g:completion_matching_smart_case = 1 -let g:completion_sorting = 'length' - -inoremap compe#confirm('') -inoremap compe#close('') -inoremap compe#scroll({ 'delta': +4 }) -inoremap compe#scroll({ 'delta': -4 }) - - -" **** End LSP - - - -"let g:qf_auto_open_quickfix = 1 -"let g:qf_auto_open_loclist = 0 - -"nmap (qf_qf_previous) -"nmap (qf_qf_next) -"nmap ge (qf_qf_toggle) - -"" Sources -"source ~/.vim/supertab.vim -"source ~/.vim/charm.vim -"source ~/.vim/plugin/AppleT.vim -runtime macros/matchit.vim - -" Completion features (TODO: Add to filetype.vim) -autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete -autocmd FileType python set tags+=$HOME/.vim/tags/python.ctags -"autocmd FileType python set omnifunc=pythoncomplete#Complete -"autocmd FileType python call SuperTabSetCompletionType("") - -" Set filetype for VimOrganizer -"au! BufRead,BufWrite,BufWritePost,BufNewFile *.org -"au BufEnter *.org call org#SetOrgFileType() - -command! OrgCapture :call org#CaptureBuffer() -command! OrgCaptureFile :call org#OpenCaptureFile() - -" Cull trailing whitespace for all files. -autocmd BufWritePre * :call AutoTrimWhitespace() - -" Set syntax and highlighting -syntax on -" baraknew is my own colorscheme. I used to use slate or dante. -"colorscheme baraknew -"let g:codedark_conservative = 1 -let g:codedark_null_background=1 -let g:codedark_italics=1 -colorscheme codedark -"colorscheme slate -"colorscheme dante - - -" Turn on the cursorline (highlight on line under cursor) but only for the -" window and buffer you're currently in. A handy trick, I'm trying out as of -" 2013-04-12 but the jury is still out. -" -" 2022-07-24 -- It's essential and I got a laugh reading this 9 years later. -autocmd BufEnter * setlocal cursorline -autocmd WinEnter * setlocal cursorline -autocmd WinLeave * setlocal nocursorline -setlocal cursorline - - -" ** PLUGIN CONFIGURATION ** - -" * SuperTab -let g:SuperTabDefaultCompletionType = "" - -" Change the source rank -"call deoplete#custom#option('sources', { - "\ 'python': ['LanguageClient'], - "\ 'cpp': ['LanguageClient'], - "\}) -"call deoplete#custom#source('buffer', 'rank', 1) -"let g:deoplete#sources#clang#libclang_path = '/usr/lib/llvm-6.0/lib/libclang.so' -"let g:deoplete#sources#clang#clang_header = '/usr/lib/llvm-6.0/lib/clang' -let g:deoplete#enable_at_startup = 1 -"let g:deoplete#sources = {} -"let g:deoplete#sources.scala = ['buffer', 'tags', 'omni'] -"let g:deoplete#omni#input_patterns = {} -"let g:deoplete#omni#input_patterns.scala = ['[^. *\t0-9]\.\w*',': [A-Z]\w', '[\[\t\( ][A-Za-z]\w*'] -" * Vim general/Unknown -let python_highlight_all = 1 -let g:Tb_MaxSize=0 -let g:Tb_MapCTabSwitchBufs = 1 -let g:UseGooglePythonSettings = 0 - -" * sneak.vim -"let g:sneak#label = 1 -"map f Sneak_f -"map F Sneak_F -"map t Sneak_t -"map T Sneak_T - -" * Jedi -let g:jedi#goto_command = "gd" -"let g:jedi#completions_enabled = 0 - -" * Eclim -let g:EclimCompletionMethod = 'omnifunc' - -" * Syntastic -let g:syntastic_python_checkers = ['python', 'pylint'] -let g:syntastic_go_checkers=['go', 'govet', 'govetshadow', 'golintc'] -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 2 -let g:syntastic_loc_list_height = 10 -" E111 = Spaces should be multiples of 4. I use 2. -" -" * Polyglot -let g:polyglot_disabled = ['latex'] - -" * ALE -let g:airline#extensions#ale#enabled = 1 -let g:ale_set_highlights = 0 - -" * LanguageServer -let g:LanguageClient_serverCommands = { - \ 'python': ['pyls'], - \ 'cpp': ['ccls'], - \ 'go': ['gopls'], - \ } -let g:LanguageClient_diagnosticsDisplay = { - \1: {'name': 'Error', 'texthl': 'ALEError', 'signText': 'E>', 'signTexthl': 'ALEErrorSign',}, - \2: {"name": "Warning", "texthl": "ALEWarning", "signText": "W>", "signTexthl": "ALEWarningSign",}, - \3: {"name": "Information", "texthl": "ALEInfo", "signText": "i-", "signTexthl": "ALEInfoSign",}, - \4: {"name": "Hint", "texthl": "ALEInfo", "signText": "--", "signTexthl": "ALEInfoSign",}, -\} -"nmap gd (lcn-definition) -"nmap K (lcn-hover) -"nmap m (lcn-menu) - -" * Configure browser for haskell_doc.vim -let g:haddock_browser = "open" -let g:haddock_browser_callformat = "%s %s" - -" * Lusty plugins -let g:LustyExplorerSuppressRubyWarning = 1 -let g:LustyJugglerSuppressRubyWarning = 1 -let g:LustyJugglerShowKeys = 'a' - -" * Buftabs -let g:buftabs_only_basename = 1 -"let g:buftabs_in_statusline=1 - -" Bufferline -let g:bufferline_echo = 0 -let g:bufferline_modified = '+' -let g:bufferline_show_bufnr = 1 -let g:bufferline_rotate = 1 - -" * NERDTree -"let g:NERDChristmasTree = 1 -"let g:NERDChristmasTree = 1 -let g:NERDTreeQuitOnOpen = 1 -let g:NERDTreeWinPos = "right" -let g:NERDTreeWinSize = 40 -let g:NERDTreeDirArrows=0 - -let g:NERDTreeMarkBookmarks = 0 -let g:NERDTreeMinimalUI = 1 - -" * Signify -let g:signify_realtime = 1 -let g:signify_vcs_list = ['git'] -let g:signify_sign_change = '~' -let g:signify_sign_changedelete = g:signify_sign_change -let g:signify_sign_show_count = 0 -let g:signify_priority = 5 - -" * Nvim Tree -let g:nvim_tree_add_trailing = 1 -let g:nvim_tree_side = 'right' -let g:nvim_tree_width = 40 -let g:nvim_tree_quit_on_open = 1 -let g:nvim_tree_disable_window_picker = 1 -let g:nvim_tree_root_folder_modifier = ':p:.' - -" * Tagbar plugin settings -let g:tagbar_width = 40 -let g:tagbar_autofocus = 1 -let g:tagbar_autoclose = 1 -let g:tagbar_compact = 1 - -" * Taglist plugin settings (deprecated) -let Tlist_GainFocus_On_ToggleOpen = 1 -let Tlist_Use_Right_Window = 1 -let Tlist_Inc_Winwidth = 0 -let Tlist_File_Fold_Auto_Close = 1 -let Tlist_WinWidth = 40 -let Tlist_Show_One_File = 0 - -" * ConqueTerm -let g:ConqueTerm_CWInsert = 1 -let g:ConqueTerm_InsertOnEnter = 0 -let g:ConqueTerm_SendVisKey = 'ss' - -" * YouCompleteMe -let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' -let g:ycm_confirm_extra_conf = 0 -let g:ycm_key_invoke_completion = "" -let g:ycm_use_ultisnips_completer = 1 -"let g:ycm_add_preview_to_completeopt = 1 -"let g:ycm_autoclose_preview_window_after_completion = 1 - -" * UltiSnips -let g:UltiSnipsSnippetDirectories=["UltiSnips", "usnips"] -let g:UltiSnipsExpandTrigger="," -"let g:UltiSnipsJumpForwardTrigger="," -let g:UltiSnipsJumpBackwardTrigger="" - -" * MinBufExplorer -"let g:miniBufExplMapWindowNavVim = 1 -"let g:miniBufExplMapWindowNavArrows = 1 -"let g:miniBufExplMapCTabSwitchBufs = 1 -"let g:miniBufExplModSelTarget = 1 -"let g:miniBufExplForceSyntaxEnable = 1 - -" Markdown -"let g:markdown_enable_folding = 1 -let g:markdown_enable_mappings = 1 -let g:markdown_enable_spell_checking = 0 -let g:markdown_enable_input_abbreviations = 0 - -" * CommandT -let g:CommandTMaxFiles = 1000 -let g:CommandTMaxDepth = 7 - -" * vim-rooter -let g:rooter_cd_cmd="lcd" -let g:rooter_manual_only = 1 -set autochdir - -" " * FZF -let g:rg_command = ' - \ rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" - \ -g "!{.git,node_modules,vendor}/*" ' - -"\ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}" - -"command! -bang -nargs=* RipGrep call fzf#vim#grep(g:rg_command .shellescape(), 1, 0) -"command! -bang -nargs=* RipGrepCword call fzf#vim#grep(g:rg_command . "-q " . expand(''), 1, 0) - -"command! -bang -nargs=* RgRoot call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case " . shellescape(), 1, {"dir": FindRootDirectory()}) - -"let g:fzf_buffers_jump = 1 -" Empty value to disable preview window altogether -"let g:fzf_preview_window = '' - -" * VimOrganizer -" default Tag list. Will be changed in near future so -" that these are defined by config lines in each .org -" file itself, but now these are where you can change things: -" let g:org_todo_setup='TODO | DONE' -" while g:org_tag_setup is itself a string -"let g:org_tag_setup='{@home(h) @work(w) @tennisclub(t)} \n {easy(e) hard(d)} \n {computer(c) phone(p)}' -"au! BufRead,BufWrite,BufWritePost,BufNewFile *.org -"au BufEnter *.org call org#SetOrgFileType() - -" * Airline -set noshowmode -let g:airline_section_c = '%{StatuslineGit()}' -let g:airline#extensions#branch#enabled = 1 -let g:airline#extensions#syntastic#enabled = 1 -let g:airline#extensions#tagbar#enabled = 1 -let g:airline_theme="murmur" -let g:airline_left_sep = '' -let g:airline_right_sep = '' -let g:airline#extensions#syntastic#enabled = 1 -let g:airline#extensions#hunks#non_zero_only = 1 -let g:airline#extensions#whitespace#enabled = 0 -let g:airline_mode_map = { - \ '__' : '-', - \ 'n' : 'N', - \ 'i' : 'I', - \ 'R' : 'R', - \ 'c' : 'C', - \ 'v' : 'V', - \ 'V' : 'V', - \ '' : 'V', - \ 's' : 'S', - \ 'S' : 'S', - \ '' : 'S', - \ } - - -" * CtrlP -let g:ctrlp_map = ',t' -let g:ctrlp_cmd = 'CtrlP' -let g:ctrlp_working_path_mode = 'ra' -let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:15' - -" * Echodoc -let g:echodoc_enable_at_startup = 1 -"let g:echodoc#type = 'floating' -"let g:echodoc#type = 'floating' -"highlight link EchoDocFloat Pmenu - -" * Vim-Go -let g:go_fmt_command = "goimports" -"let g:go_auto_type_info = 1 -let g:go_updatetime = 300 -let g:go_bin_path = $HOME . "/.go/bin" -"let g:go_def_mode = 'gopls' -"let g:go_info_mode = 'gopls' - -let g:go_highlight_functions = 1 -let g:go_highlight_function_calls = 1 -"let g:go_highlight_variable_declarations = 1 -"let g:go_highlight_variable_assignments = 1 - -" ** STATUSLINE ** -set laststatus=2 -set statusline=%t "tail of the filename -"set statusline+=[%{&ff}] "file format -"set statusline+=%h "help file flag -set statusline+=\ %w "help file flag -set statusline+=%r "read only flag -set statusline+=%y "filetype -set statusline+=\ %m "modified flag -set statusline+=%= "left/right separator -set statusline+=%{fugitive#statusline()}\ \ -set statusline+=%c, "cursor column -set statusline+=%l/%L "cursor line/total lines -set statusline+=\ %P "percent through file - -" ** SMALL FUNCTIONS THAT DON'T FIT AS PLUGINS *** - -" Add capital W and Q so I can be lazy about my shift key -if !exists(":W") - command W :w -endif - -if !exists(":Q") - command Q :q -endif - -" CD to the path of the file I'm editing. -command Cdf :cd %:p:h - -" Print path of file -command Filepath :echo expand('%:p') - -" Save a vim session! Useful if you want to save buffer states and so on -command SaveSession :mksession! ~/.vim_last_session -command LoadSession :source ~/.vim_last_session - -" This is a quick way to edit a persistent scratch buffer for me... -command ScratchOpen :e scp://barak@barakmich.com//home/barak/notes/scratch - -" Sudo-make-me-a-sandwich write. For when I forget to be root. -"command Wdammit :w !sudo tee > /dev/null % -command Wdammit :w suda://% - - -" I can never remember markdown fully. Open me a cheatsheet -command MarkdownCheatsheet :rightb vsplit ~/.vim/markdown_cheatsheet.md - - -" Doesn't quite work right but can be a real savior if needed. -" Oh-shit-what-was-this-like-before-I-changed-it? -function! s:DiffWithSaved() - let filetype=&ft - diffthis - vnew | r # | normal! 1Gdd - diffthis - exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype -endfunction -com! DiffSaved call s:DiffWithSaved() - -" Highlight lines that are longer than textwidth for the filetype, commonly 80 -" characters. -function! HighlightTooLongLines() - highlight def link RightMargin Error - if &textwidth != 0 - exec 'match RightMargin /\%<' . (&textwidth + 3) . 'v.\%>' . (&textwidth + 1) . 'v/' - endif -endfunction - -" Toggles the quickfix window split. -command -bang -nargs=? QFix call QFixToggle(0) -function! QFixToggle(forced) - if exists("g:qfix_win") && a:forced == 0 - cclose - else - execute "copen " . 15 - endif -endfunction - -" Toggle LocationList -command -bang -nargs=? LFix call LFixToggle(0) -function! LFixToggle(forced) - if exists("g:lfix_win") && a:forced == 0 - unlet! g:lfix_win - lclose - else - execute "lopen " . 10 - let g:lfix_win = "t" - endif -endfunction - -"au FileType go nmap C (go-clearlay) -"clear overlay -command -bang -nargs=? GoCoverlayT call GoCoverlayToggle(0) -function! GoCoverlayToggle(forced) - if exists("g:go_coverlay_t") && a:forced == 0 - unlet! g:go_coverlay_t - GoClearlay - "call (go-clearlay) - else - "call (go-coverlay) - GoCoverlay - let g:go_coverlay_t = "t" - endif -endfunction - - -" Toggle GoCoverlay -au FileType go nmap c :GoCoverlayT - -" Coquille -au FileType coq nmap a :CoqToCursor -au FileType coq imap a :CoqToCursor - -" Make the Quickfix window respond well to commands (for instance, q to close, -" Enter to select, etc). In tandem with the above. -augroup QFixToggle - autocmd! - autocmd BufWinEnter quickfix let g:qfix_win = bufnr("$") - autocmd BufWinEnter quickfix exec "nnoremap q :QFix" - autocmd BufWinLeave * if exists("g:qfix_win") && expand("") == g:qfix_win | unlet! g:qfix_win | endif -augroup END - - -" Execute a command that pipes output to window. Captures output into a new, -" appropriately titled, buffer. -function! s:ExecuteInShellOutput(command) - let command = join(map(split(a:command), 'expand(v:val)')) - let winnr = bufwinnr('^' . command . '$') - silent! execute winnr < 0 ? 'botright new ' . fnameescape(command) : winnr . 'wincmd w' - setlocal buftype=nowrite bufhidden=wipe nobuflisted noswapfile wrap number - echo 'Executing ' . command . '...' - silent! execute 'silent %!'. command -" uncomment this if you want the new buffer to try to grow to accommodate the output - "silent! execute 'resize ' . line('$') - silent! redraw - silent! execute 'au BufUnload execute bufwinnr(' . bufnr('#') . ') . ''wincmd w''' - silent! execute 'nnoremap r :call ExecuteInShell(''' . command . ''')' - echo 'Execution of ' . command . ' complete.' -endfunction - -" Same as above, doesn't capture output -function! s:ExecuteInShell(command) - let command = join(map(split(a:command), 'expand(v:val)')) - silent! execute 'silent !'. command - redraw! - echo 'Execution of ' . command . ' complete.' -endfunction - -command! -complete=shellcmd -nargs=+ Shell call s:ExecuteInShellOutput() -command! -complete=shellcmd -nargs=+ Exec call s:ExecuteInShell() -command! -nargs=* Make call s:ExecuteInShellOutput('make '.) -command! -nargs=* PTW call s:ExecuteInShell('ptw post --client=vim "'..'"') -command! -nargs=* CaptureNote :AsyncRun -silent capture --viewing %:p 2>&1 > /dev/null - -" Highlight all instances of word under cursor, when idle. -" Useful when studying strange source code. -" Type z/ to toggle highlighting on/off. -nnoremap z/ :if AutoHighlightToggle()set hlselseset nohlsendif -function! AutoHighlightToggle() - let @/ = '' - if exists('#auto_highlight') - au! auto_highlight - augroup! auto_highlight - setl updatetime=4000 - echo 'Highlight current word: off' - return 0 - else - augroup auto_highlight - au! - au CursorHold * let @/ = '\V\<'.escape(expand(''), '\').'\>' - augroup end - setl updatetime=500 - echo 'Highlight current word: ON' - return 1 - endif -endfunction - -" Removes trailing spaces -function AutoTrimWhitespace() - if exists("b:auto_trim_whitespace") - if b:auto_trim_whitespace == 1 - let l:winview = winsaveview() - silent! %s/\s\+$// - call winrestview(l:winview) - endif - endif -endfunction - - -function! StatuslineGit() - let l:root = finddir('.git/..', expand('%:p:h').';') - return expand('%:p:s!'. l:root . '!/!') -endfunction - -function InstallEverything() - GoUpdateBinaries - BlackUpgrade -endfunction - -command CocReinstall :CocInstall coc-json coc-pyright coc-rust-analyzer coc-snippets coc-svelte coc-tsserver coc-ultisnips - - -autocmd FileType defx call s:defx_my_settings() -function! s:defx_my_settings() abort - " Define mappings - nnoremap - \ line('.') == 1 ? defx#do_action('cd', ['..']) : defx#do_action('open') - nnoremap c - \ defx#do_action('copy') - nnoremap m - \ defx#do_action('move') - nnoremap p - \ defx#do_action('paste') - nnoremap l - \ defx#do_action('open') - nnoremap E - \ defx#do_action('open', 'vsplit') - nnoremap P - \ defx#do_action('preview') - nnoremap o - \ defx#do_action('open_tree', 'toggle') - nnoremap K - \ defx#do_action('new_directory') - nnoremap N - \ defx#do_action('new_file') - nnoremap M - \ defx#do_action('new_multiple_files') - nnoremap C - \ defx#do_action('toggle_columns', - \ 'mark:indent:icon:filename:type:size:time') - nnoremap S - \ defx#do_action('toggle_sort', 'time') - nnoremap d - \ defx#do_action('remove') - nnoremap r - \ defx#do_action('rename') - nnoremap ! - \ defx#do_action('execute_command') - nnoremap x - \ defx#do_action('execute_system') - nnoremap yy - \ defx#do_action('yank_path') - nnoremap . - \ defx#do_action('toggle_ignored_files') - nnoremap ; - \ defx#do_action('repeat') - nnoremap h - \ defx#do_action('cd', ['..']) - nnoremap ~ - \ defx#do_action('cd') - nnoremap q - \ defx#do_action('quit') - nnoremap - \ defx#do_action('toggle_select') . 'j' - nnoremap * - \ defx#do_action('toggle_select_all') - nnoremap j - \ line('.') == line('$') ? 'gg' : 'j' - nnoremap k - \ line('.') == 1 ? 'G' : 'k' - nnoremap - \ defx#do_action('redraw') - nnoremap - \ defx#do_action('print') - nnoremap cd - \ defx#do_action('change_vim_cwd') -endfunction - - -" ** KEY REMAPPINGS ** -" -" I used to use tabs, but then I took an arrow to the knee. -" Tabs in vim suck because they aren't what you want. Use tabbar. -"nnoremap gc :tabnew -"nnoremap gK :tabclose -"nnoremap gn gt -"nnoremap gp gT - -" I don't know how I came up with gt for opening the tree, but it stuck. -"nmap gt :NERDTreeToggle -"nmap gt :VimFilerExplorer -winwidth=40 -toggle -direction=rightbelow -parent -status -force-hide -"nmap gt :VimFiler -status -auto-cd -parent -force-quit -"nmap gt :Defx `escape(expand('%:p:h'), ' :')` -search=`expand('%:p')` -columns=icons:indent:filename:type -nmap gt :edit . -""nnoremap gt :NvimTreeToggle -" The same for the TagList, useful for large C files. -"nmap gb :TlistToggle -nmap gb :TagbarToggle -"nnoremap gx :Kwbd -" :Kwbd (defined below) really kills a buffer dead, and closes the window. -" gK is similar. -nnoremap gc :Kwbd -"nnoremap gc :bdelete -"nnoremap gK :bdelete! - -" I use gn/gp to cycle through open tabs/buffers -nnoremap gn :bn -nnoremap gp :bp -nnoremap gz :pclose -" The single most handy way to get around a file. Cursor over a word, and then -" type g* -- you'll go to the next instance of that word in the file. Make it -" easier to reach by calling it gw (go-word) instead of hidden away. -nnoremap gw g* -" Make shift-p like p except, put the line above instead of below. -nmap P op -" Line-based movement is cute, but it's tricky for files with lines that wrap. -" Attune more to what you see on the screen instead of where the lines actually -" are. -nnoremap j gj -nnoremap k gk -xnoremap j gj -xnoremap k gk -nnoremap gj -nnoremap gk -xnoremap gj -xnoremap gk -inoremap gj -inoremap gk -"nnoremap -" Years of using bash and zsh have caused my fingers to expect these Emacs-like -" mappings to exist. Make them exist in vim as well. But eye them with -" suspicion, as they come from Emacs. -nnoremap ^ -nnoremap $ -xnoremap ^ -xnoremap $ -inoremap ^ -inoremap $ - -" Dealing with split windows is a pain. Make it less of a pain, by making -" Ctrl-direction appropriate. -"nnoremap j -"nnoremap k -"nnoremap l -"nnoremap h -""nnoremap w -""nnoremap W -"inoremap j -"inoremap k -"inoremap l -"inoremap h - -"if has('nvim') - "tnoremap - "tnoremap j - "tnoremap k - "tnoremap l - "tnoremap h -"endif - -" Make it easier to clear highlighting, with no functionality penalty -nnoremap :noh - -" Better fold mappings -nnoremap @=(foldlevel('.')?'za':'l') -vnoremap zf -" Just to be handy, Ctrl-C acts like escape. So does jj, which never really -" comes up in practice. If you really need to type jj do so slowly. -imap -inoremap jj - -" Leader key functions -" See quickfix. -"nnoremap ff :LFix -" See quickfix. -nnoremap ss :SyntasticSetLoclist -" Next quickfix. -nnoremap fn :lnext -" Prev quickfix. -nnoremap fp :lprev -"nnoremap aa :Denite -mode=normal -buffer-name=search-buffer grep -nnoremap ac :Denite -resume -buffer-name=search-buffer grep -"nnoremap aw :DeniteCursorWord -buffer-name=search-buffer grep -" -nnoremap nn :CaptureNote -call denite#custom#map('insert', '', '') -"call denite#custom#var('grep', 'command', ['rg']) -"call denite#custom#var('grep', 'default_opts', - "\ ['--no-heading', '--color', 'never', '--smart-case']) -"call denite#custom#var('grep', 'recursive_opts', []) -"call denite#custom#var('grep', 'pattern_opt', []) -"call denite#custom#var('grep', 'separator', ['--']) -"call denite#custom#var('grep', 'final_opts', []) -"call denite#custom#option('search-buffer', 'highlight_matched_char', 'deniteMatchedChar') -call denite#custom#var('grep', { - \ 'command': ['rg'], - \ 'default_opts': ['-i', '--vimgrep', '--no-heading'], - \ 'recursive_opts': [], - \ 'pattern_opt': ['--regexp'], - \ 'separator': ['--'], - \ 'final_opts': [], - \ }) -"nnoremap g :Denite -buffer-name=search-buffer grep -"nnoremap aa :RipGrep! -nnoremap aa :RgRoot! -"nnoremap aw :RgRoot! -"nnoremap :Files! `git rev-parse --show-toplevel` -"nnoremap :GFiles -nnoremap lua require('telescope.builtin').git_files{} -nnoremap ag lua require('telescope.builtin').live_grep{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1], search = ''} -nnoremap aw lua require('telescope.builtin').grep_string{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1]} -nnoremap q lua require('telescope.builtin').quickfix{} -nnoremap ff lua require('telescope.builtin').quickfix{} - -" For C++ -- A is a great plugin which allows you to jump from the c file to the -" header and vice-versa. Mneumonic here is headerheader. -nnoremap hh :A -" CommandT is useful, but if I'm juggling lots of buffers, limit it to another -" one I have open (instead of standard t). -"nnoremap o :Buffers -nnoremap o lua require('telescope.builtin').buffers{initial_mode = "insert"} -nnoremap lua require('telescope.builtin').buffers{prompt_prefix = " "} -"nnoremap j -"nnoremap p :PTW -nnoremap p :LustyJugglePrevious -nnoremap jd :YcmCompleter GoToDefinitionElseDeclaration -nnoremap mm :w:make! - -" ** EXTRA INCLUDES ** -" -let s:extrarc = expand($HOME . '/.vimrc_google') -if filereadable(s:extrarc) - exec ':so ' . s:extrarc -endif - -" ** SEE ALSO ** -" filetype.vim - -"call remote#host#RegisterPlugin('python3', '/home/barak/.vim/bundle/deoplete.nvim/rplugin/python3/deoplete', [ - "\ {'sync': v:true, 'name': '_deoplete', 'type': 'function', 'opts': {}}, - "\ ]) -" -if !empty($VIRTUAL_ENV) -" let g:python_host_prog = $VIRTUAL_ENV . '/bin/python' -" let g:python3_host_prog = $VIRUTAL_ENV . '3/bin/python' -endif - -autocmd FileType denite call s:denite_my_settings() -function! s:denite_my_settings() abort - nnoremap - \ denite#do_map('do_action') - "nnoremap d - "\ denite#do_map('do_action', 'delete') - "nnoremap p - "\ denite#do_map('do_action', 'preview') - nnoremap q - \ denite#do_map('quit') - nnoremap i - \ denite#do_map('open_filter_buffer') - nnoremap - \ denite#do_map('toggle_select').'j' -endfunction - -map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" - -function! Syn() - for id in synstack(line("."), col(".")) - echo synIDattr(id, "name") - endfor -endfunction -map command! -nargs=0 Syn call Syn() - -" Final hi links for TreeSitter - -hi link @type.rust TSCSecondaryTypeParam - -let s:gptool_temp = expand($HOME . '/src/gptool/bindings.vim') -if filereadable(s:gptool_temp) - exec ':so ' . s:gptool_temp -endif diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index ff3638e..0000000 --- a/.yarnrc +++ /dev/null @@ -1,6 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -lastUpdateCheck 1711242871592 -prefix "/home/barak/.yarn" diff --git a/dot_tmux.conf b/dot_tmux.conf new file mode 100644 index 0000000..b3542e5 --- /dev/null +++ b/dot_tmux.conf @@ -0,0 +1,131 @@ +set -g prefix C-a +unbind C-b + +set -g base-index 1 +setw -g pane-base-index 1 + +# Make vim more responsive +set -sg escape-time 10 + +bind-key C-o last-window +bind-key C-a select-pane -t :.+ +bind-key a send-prefix +bind r source-file ~/.tmux.conf +bind -n M-j select-pane -D +bind -n M-k select-pane -U +bind -n M-h select-pane -L +bind -n M-l select-pane -R +bind -n M-n next-window +bind -n M-p previous-window +bind-key C-n next-window +bind-key C-p previous-window +set -g set-titles off +set -g mouse on +set -g default-terminal tmux-256color +set-option -g default-shell /bin/fish +setw -g mode-keys vi +new -d + + +# shift-movement keys will resize panes +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# better mnemonics for splitting panes! +#bind | split-window -h +#bind - split-window -v + +bind-key h select-pane -L +bind-key k select-pane -U +bind-key j select-pane -D +bind-key l select-pane -R + +bind-key u break-pane +#bind-key sdf command-prompt -p "join pane from:" "join-pane -s '%%'" +bind-key y command-prompt -p "send pane to:" "join-pane -t :'%%' \; select-layout main-vertical" +bind-key Enter rotate-window + +bind v split-window -h +bind = select-layout even-horizontal +bind | select-layout main-vertical +bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`" + +# Status Bar +##set -g status-bg black +set -g status-interval 5 +##set -g status-left '#[fg=green]#H#[default]' +##set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' +#set -g status-justify centre # center align window list +#set -g status-style fg=white,bg=default + +## default window title colors +#set-window-option -g window-status-style fg=white,bg=default,dim + +## active window title colors +#set -g main-pane-width 68% +#set-window-option -g window-status-current-style fg=cyan,bg=default,bright + +#set-window-option -g window-style fg=#999999,bg=terminal +#set-window-option -g window-active-style fg=terminal,bg=terminal + +#set -g status-left '#[fg=green][ #h ][' +#set -g status-left-length 40 +#set -g status-right '#[fg=green]][#(battery) #{pane_width}x#{pane_height} #[bright]#[fg=blue]%Y-%m-%d #[fg=white]%I:%M #[dim]#[fg=green]]' +#set -g status-right-length 40 +set-window-option -g window-status-activity-style none +# Notifying if other windows has activities +set -g monitor-activity on +set -g visual-activity off +set -g visual-bell on +set -g bell-action none +set -g activity-action none + +# Highlighting the active window in status bar +#setw -g window-status-current-style bg=red,bright +set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha + +set -g @catppuccin_window_status_enable "yes" +set -g @catppuccin_window_number_position "left" +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_right_separator " " +set -g @catppuccin_window_middle_separator " " +set -g @catppuccin_window_connect_separator "yes" + +set -g @catppuccin_window_default_color "#{thm_gray}" +set -g @catppuccin_window_default_background "#{thm_green}" +set -g @catppuccin_window_default_fill "all" +set -g @catppuccin_window_default_text "#W" + +set -g @catppuccin_window_current_fill "all" +set -g @catppuccin_window_current_text "#W" +set -g @catppuccin_window_current_color "#{thm_blue}" +set -g @catppuccin_window_current_background "#{thm_bg}" + +set -g @catppuccin_icon_window_last "󰖰" +set -g @catppuccin_icon_window_current "󰫣" +set -g @catppuccin_icon_window_zoom "󰁌" +set -g @catppuccin_icon_window_mark "󰃀" +set -g @catppuccin_icon_window_silent "󰂛" +set -g @catppuccin_icon_window_activity "󱅫" +set -g @catppuccin_icon_window_bell "󰂞" + +set -g @catppuccin_status_modules_right "directory battery host date_time" +set -g @catppuccin_status_left_separator "" +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_fill "icon" +set -g @catppuccin_status_connect_separator "yes" +set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M" + +set -g @catppuccin_pane_status_enabled "yes" + + +set -g @catppuccin_directory_text "#{pane_current_path}" +set -g @plugin 'catppuccin/tmux' + + +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tpm' +run -b '~/.tmux/plugins/tpm/tpm' +# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm diff --git a/dot_vimrc b/dot_vimrc new file mode 100644 index 0000000..3ba9369 --- /dev/null +++ b/dot_vimrc @@ -0,0 +1,1116 @@ +" ___ _ _ _ +" | _ ) __ _ _ _ __ _| |_( )___ __ _(_)_ __ _ _ __ +" | _ \/ _` | '_/ _` | / //(_-< \ V / | ' \| '_/ _| +" |___/\__,_|_| \__,_|_\_\ /__/ (_)_/|_|_|_|_|_| \__| +" +" +" ** BASIC EDITOR SETTINGS ** +" +" First, we are vim, not vi, so start as many others do with +set nocompatible + +" Allow background buffers. Super important for various tab modes. +set hidden + +" Set default spacing. +" Hard tabs should show as 8. +set ts=8 +" Soft tabs should be 2 wide, and we should use spaces. +" (This is the Googler in me. I've converted to spaces over +" the years because it really is more consistent.) +set softtabstop=2 +set shiftwidth=2 +set expandtab +" I like comma instead of slash, but that probably comes from playing +" Nethack and Angband +let mapleader = "," +let maplocalleader = "\\" + +" Set 'smart' things in Vim +" Search case insensitive, unless it contains Uppercase letters +set smartcase +" Use all the indent features +set autoindent +set smartindent +set cindent +" Make backspace remove indents and line breaks, like a normal editor +set backspace=indent,eol,start + +" Keep a bigger history +set history=1000 +" Allow tab completion for files in command mode. +set wildmenu +set wildmode=list:longest +" Show where you are in the file in the statusbar. +set ruler + +" I hate split above, so make it split below. Likewise, to the right. +set splitbelow +" For autocomplete, follow requirements for nvim-compe +set completeopt=menuone,noselect +set signcolumn=yes +set shortmess+=c + +set diffopt+=vertical +" Some stuff for 256-Color consoles that I've forgotten. +set t_Co=256 +set t_Sf=ESC[3%dm +set t_Sb=ESC[4%dm +set t_ut= +"set t_SH= +"set t_kb= + +" This is like HiglightTooLongLines below, but for modern vim. The problem is +" that it highlights the column, even if your short. Good for measuring, bad for +" my eyes. +"if v:version >= 703 + "set relativenumber + "set colorcolumn=81 +"endif +" ** PATH SETTINGS ** + +let g:loaded_python_provider = 0 +let $RUST_SRC_PATH="/usr/src/rust/src/" + +"let g:ft_ignore_pat = '.org' +" + +if exists('veonim') + let g:vscode_extensions = [ + \'ms-python.python', + \'ms-vscode.go', + \] + set guifont=Droid\ Sans\ Mono\ Dotted:h20 +" set linespace=10 +endif + +if exists('g:neovide') + let g:neovide_floating_blur_amount_x = 2.0 + let g:neovide_floating_blur_amount_y = 2.0 + let g:neovide_transparency = 0.95 + let g:neovide_scroll_animation_length = 0.1 + let g:neovide_cursor_animation_length = 0.05 + let g:neovide_cursor_trail_size = 0.5 +endif + + +" * Polyglot + +let g:tex_flavor = 'latex' +let g:polyglot_disabled = ['latex'] +let g:powerline_loaded = 1 + + +" Required: +set runtimepath+=$HOME/.vim/bundle/repos/github.com/Shougo/dein.vim + +" Required: +call plug#begin($HOME . '/.vim/bundle') + +" Plugins that must be first +Plug $HOME . '/.vim/bundle/repos/github.com/Shougo/dein.vim' +Plug 'let-def/vimbufsync' +Plug 'lambdalisue/suda.vim' +Plug 'skywind3000/asyncrun.vim' +Plug 'barakmich/vim-code-dark' + +" Plugins that I almost never use +"Plug 'vim-scripts/DrawIt' +"Plug 'vim-scripts/EasyGrep' +Plug 'chrisbra/NrrwRgn' +"Plug 'mattn/calendar-vim' +"Plug 'rstacruz/sparkup' +"Plug 'tristen/vim-sparkup' +"Plug 'tpope/vim-fireplace', {'for': 'clojure'} +""Plug 'terryma/vim-multiple-cursors' +"Plug 'ambv/black' +Plug 'kana/vim-textobj-user' + + +" Plugins I wish I used more +"Plug 'hsitz/VimOrganizer' +Plug 'jceb/vim-orgmode' +Plug 'tpope/vim-speeddating' + +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-unimpaired' +Plug 'b4winckler/vim-angry' +Plug 'tpope/vim-surround' +Plug 'junegunn/vim-easy-align' +Plug 'bps/vim-textobj-python' + +" Plugins I NEED +Plug 'scrooloose/nerdcommenter' +Plug 'sjbach/lusty' +"Plug 'w0rp/ale' +"Plug 'airblade/vim-gitgutter' +Plug 'mhinz/vim-signify' +"Plug 'vim-airline/vim-airline' +"Plug 'vim-airline/vim-airline-themes' +Plug 'nvim-lualine/lualine.nvim' +Plug 'linrongbin16/lsp-progress.nvim' +"Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +"Plug 'junegunn/fzf.vim' +Plug 'airblade/vim-rooter' +"Plug 'bling/vim-bufferline' +Plug 'majutsushi/tagbar' +"Plug 'SirVer/ultisnips' +Plug 'dcampos/nvim-snippy' +Plug 'rafamadriz/friendly-snippets' + +Plug 'honza/vim-snippets' +"Plug 'fatih/vim-go' +Plug 'tpope/vim-abolish' +"Plug 'sheerun/vim-polyglot' +Plug 'Shougo/denite.nvim' +"Plug 'plytophogy/vim-virtualenv' +"Plug 'ervandew/supertab' +"Plug 'ncm2/ncm2' +"Plug 'roxma/nvim-yarp' + + +" Plugins I NEEDED +"Plug 'scrooloose/nerdtree' +"Plug 'scrooloose/syntastic' +"Plug 'Valloric/YouCompleteMe' +"Plug 'vim-scripts/fish-syntax' +"Plug 'kchmck/vim-coffee-script' +"Plug 'rodjek/vim-puppet' +"Plug 'JuliaLang/julia-vim' +"Plug 'rust-lang/rust.vim' +"Plug 'hashivim/vim-terraform' +"Plug 'HerringtonDarkholme/yats.vim' +"Plug 'kien/ctrlp.vim' +"Plug 'farseer90718/vim-taskwarrior' +"Plug 't-yuki/vim-go-coverlay' + +" Plugins for syntax +Plug 'lunaru/vim-less' +Plug 'hylang/vim-hy', {'for': 'hy'} +Plug 'jneen/ragel.vim' +Plug 'NoahTheDuke/vim-just' +"Plug 'mhartington/nvim-typescript' +"Plug 'leafgarland/typescript-vim' +Plug 'leafOfTree/vim-svelte-plugin' +"Plug 'posva/vim-vue' +Plug 'Shougo/context_filetype.vim' +"Plug 'idris-hackers/idris-vim', {'for': 'idris'} +Plug 'fedorenchik/AnsiEsc' +Plug 'hwayne/tla.vim' +Plug 'zchee/vim-goasm' +Plug 'cappyzawa/starlark.vim' + +" Plugins that autocomplete +"Plug 'Shougo/deoplete.nvim' +"Plug 'zchee/deoplete-clang' +"Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}} +"Plug 'zchee/deoplete-jedi' +"Plug 'davidhalter/jedi-vim' +"Plug 'eagletmt/neco-ghc', {'for': 'haskell'} +"Plug 'eagletmt/ghcmod-vim', {'for': 'haskell'} +"Plug 'racer-rust/vim-racer', {'for': 'rust'} +"Plug 'autozimu/LanguageClient-neovim', { + "\ 'branch': 'next', + "\ 'do': 'bash install.sh', + "\ } +"Plug 'ensime/ensime-vim', { 'do': ':UpdateRemotePlugins' } +"Plug 'neoclide/coc.nvim', {'branch': 'release'} +"Plug 'romainl/vim-qf' +Plug 'neovim/nvim-lspconfig' +Plug 'nvim-lua/lsp_extensions.nvim' +Plug 'hrsh7th/nvim-compe' +"Plug 'nvim-lua/completion-nvim' +Plug 'onsails/lspkind-nvim' + +Plug 'nvim-lua/popup.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim' +Plug 'sindrets/diffview.nvim' + +Plug 'kyazdani42/nvim-web-devicons' " for file icons +"Plug 'kyazdani42/nvim-tree.lua' + +Plug 'ray-x/lsp_signature.nvim' +Plug 'ray-x/go.nvim' + +Plug 'RishabhRD/popfix' +Plug 'RishabhRD/nvim-lsputils' +Plug 'stevanmilic/nvim-lspimport' +Plug 'folke/trouble.nvim' +Plug 'creativenull/efmls-configs-nvim', { 'tag': 'v1.*' } + +" Plugins that do specific things +"Plug 'Shougo/vimproc.vim' +"Plug 'Shougo/vimfiler.vim' + +Plug 'tamago324/lir.nvim' + +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'nvim-treesitter/playground' +Plug 'nvim-treesitter/nvim-treesitter-textobjects' + + +"Plug 'ggandor/lightspeed.nvim' +"Plug 'justinmk/vim-sneak' +Plug 'ggandor/leap.nvim' +Plug 'ggandor/flit.nvim' +Plug 'simrat39/rust-tools.nvim' + +Plug 'Shougo/unite.vim' +" TODO: Look into Coqtail, same author +Plug 'whonore/coquille', {'branch': 'pathogen-bundle', 'for': 'coq'} +"Plug 'dhruvasagar/vim-zoom' +Plug 'gabrielelana/vim-markdown' +Plug 'lervag/vimtex' +Plug 'Shougo/echodoc.vim' +"Plug 'python-rope/ropevim' +Plug 'windwp/nvim-autopairs' +Plug 'danymat/neogen' + +" Unclear +"Plug 'ncm2/float-preview.nvim' +Plug 'lambdalisue/gina.vim' +Plug 'edolphin-ydf/goimpl.nvim' + +call plug#end() + +filetype plugin indent on +syntax enable + +" enable ncm2 for all buffers +"autocmd BufEnter * call ncm2#enable_for_buffer() + + +" **** Configure LSP + +luafile $HOME/.vim/nvim.lua + + +" Code navigation shortcuts +nnoremap gd lua vim.lsp.buf.definition() +nnoremap gi lua vim.lsp.buf.implementation() +nnoremap gy lua vim.lsp.buf.type_definition() +nnoremap K lua vim.lsp.buf.hover() +nnoremap gs lua vim.lsp.buf.signature_help() +nnoremap gR lua vim.lsp.buf.rename() +"nnoremap gr lua vim.lsp.buf.references() +nnoremap gr lua require('telescope.builtin').lsp_references({initial_mode = "normal"}) +nnoremap g0 lua vim.lsp.buf.document_symbol() +nnoremap gW lua vim.lsp.buf.workspace_symbol() +"nnoremap gd lua vim.lsp.buf.declaration() +nnoremap ga lua vim.lsp.buf.code_action() +"nnoremap ga lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"}) +vnoremap ga lua vim.lsp.buf.code_action() +"vnoremap ga :lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"}) +"nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) +"nnoremap ge lua vim.diagnostic.open_float({focusable = false}) + +nnoremap xx TroubleToggle +nnoremap xq lua vim.diagnostic.setqflist() +"nnoremap nc lua neogen_dwim() +nnoremap nc lua require('neogen').generate({ type = 'any' }) +nnoremap gm lua require('lspimport').import() + + +" Set updatetime for CursorHold +" 300ms of no cursor movement to trigger CursorHold +set updatetime=500 +" Show diagnostic popup on cursor hold +autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) + +" Autoformat on save +autocmd BufWritePre *.lua lua vim.lsp.buf.format({ async = false }) +autocmd BufWritePre *.py lua vim.lsp.buf.format({ async = false }) +autocmd BufWritePre *.rs lua vim.lsp.buf.format({ async = false }) +autocmd BufWritePre *.go lua vim.lsp.buf.format({ async = false }) +autocmd BufWritePre *.go silent! lua org_imports(3000) +autocmd BufWritePre *.ts lua vim.lsp.buf.format({ async = false }) + +" Goto previous/next diagnostic warning/error +nnoremap g[ lua vim.diagnostic.goto_prev() +nnoremap g] lua vim.diagnostic.goto_next() + +let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] +let g:completion_matching_smart_case = 1 +let g:completion_sorting = 'length' + +inoremap compe#confirm('') +inoremap compe#close('') +inoremap compe#scroll({ 'delta': +4 }) +inoremap compe#scroll({ 'delta': -4 }) + + +" **** End LSP + + + +"let g:qf_auto_open_quickfix = 1 +"let g:qf_auto_open_loclist = 0 + +"nmap (qf_qf_previous) +"nmap (qf_qf_next) +"nmap ge (qf_qf_toggle) + +"" Sources +"source ~/.vim/supertab.vim +"source ~/.vim/charm.vim +"source ~/.vim/plugin/AppleT.vim +runtime macros/matchit.vim + +" Completion features (TODO: Add to filetype.vim) +autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete +autocmd FileType python set tags+=$HOME/.vim/tags/python.ctags +"autocmd FileType python set omnifunc=pythoncomplete#Complete +"autocmd FileType python call SuperTabSetCompletionType("") + +" Set filetype for VimOrganizer +"au! BufRead,BufWrite,BufWritePost,BufNewFile *.org +"au BufEnter *.org call org#SetOrgFileType() + +command! OrgCapture :call org#CaptureBuffer() +command! OrgCaptureFile :call org#OpenCaptureFile() + +" Cull trailing whitespace for all files. +autocmd BufWritePre * :call AutoTrimWhitespace() + +" Set syntax and highlighting +syntax on +" baraknew is my own colorscheme. I used to use slate or dante. +"colorscheme baraknew +"let g:codedark_conservative = 1 +let g:codedark_null_background=1 +let g:codedark_italics=1 +colorscheme codedark +"colorscheme slate +"colorscheme dante + + +" Turn on the cursorline (highlight on line under cursor) but only for the +" window and buffer you're currently in. A handy trick, I'm trying out as of +" 2013-04-12 but the jury is still out. +" +" 2022-07-24 -- It's essential and I got a laugh reading this 9 years later. +autocmd BufEnter * setlocal cursorline +autocmd WinEnter * setlocal cursorline +autocmd WinLeave * setlocal nocursorline +setlocal cursorline + + +" ** PLUGIN CONFIGURATION ** + +" * SuperTab +let g:SuperTabDefaultCompletionType = "" + +" Change the source rank +"call deoplete#custom#option('sources', { + "\ 'python': ['LanguageClient'], + "\ 'cpp': ['LanguageClient'], + "\}) +"call deoplete#custom#source('buffer', 'rank', 1) +"let g:deoplete#sources#clang#libclang_path = '/usr/lib/llvm-6.0/lib/libclang.so' +"let g:deoplete#sources#clang#clang_header = '/usr/lib/llvm-6.0/lib/clang' +let g:deoplete#enable_at_startup = 1 +"let g:deoplete#sources = {} +"let g:deoplete#sources.scala = ['buffer', 'tags', 'omni'] +"let g:deoplete#omni#input_patterns = {} +"let g:deoplete#omni#input_patterns.scala = ['[^. *\t0-9]\.\w*',': [A-Z]\w', '[\[\t\( ][A-Za-z]\w*'] +" * Vim general/Unknown +let python_highlight_all = 1 +let g:Tb_MaxSize=0 +let g:Tb_MapCTabSwitchBufs = 1 +let g:UseGooglePythonSettings = 0 + +" * sneak.vim +"let g:sneak#label = 1 +"map f Sneak_f +"map F Sneak_F +"map t Sneak_t +"map T Sneak_T + +" * Jedi +let g:jedi#goto_command = "gd" +"let g:jedi#completions_enabled = 0 + +" * Eclim +let g:EclimCompletionMethod = 'omnifunc' + +" * Syntastic +let g:syntastic_python_checkers = ['python', 'pylint'] +let g:syntastic_go_checkers=['go', 'govet', 'govetshadow', 'golintc'] +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 2 +let g:syntastic_loc_list_height = 10 +" E111 = Spaces should be multiples of 4. I use 2. +" +" * Polyglot +let g:polyglot_disabled = ['latex'] + +" * ALE +let g:airline#extensions#ale#enabled = 1 +let g:ale_set_highlights = 0 + +" * LanguageServer +let g:LanguageClient_serverCommands = { + \ 'python': ['pyls'], + \ 'cpp': ['ccls'], + \ 'go': ['gopls'], + \ } +let g:LanguageClient_diagnosticsDisplay = { + \1: {'name': 'Error', 'texthl': 'ALEError', 'signText': 'E>', 'signTexthl': 'ALEErrorSign',}, + \2: {"name": "Warning", "texthl": "ALEWarning", "signText": "W>", "signTexthl": "ALEWarningSign",}, + \3: {"name": "Information", "texthl": "ALEInfo", "signText": "i-", "signTexthl": "ALEInfoSign",}, + \4: {"name": "Hint", "texthl": "ALEInfo", "signText": "--", "signTexthl": "ALEInfoSign",}, +\} +"nmap gd (lcn-definition) +"nmap K (lcn-hover) +"nmap m (lcn-menu) + +" * Configure browser for haskell_doc.vim +let g:haddock_browser = "open" +let g:haddock_browser_callformat = "%s %s" + +" * Lusty plugins +let g:LustyExplorerSuppressRubyWarning = 1 +let g:LustyJugglerSuppressRubyWarning = 1 +let g:LustyJugglerShowKeys = 'a' + +" * Buftabs +let g:buftabs_only_basename = 1 +"let g:buftabs_in_statusline=1 + +" Bufferline +let g:bufferline_echo = 0 +let g:bufferline_modified = '+' +let g:bufferline_show_bufnr = 1 +let g:bufferline_rotate = 1 + +" * NERDTree +"let g:NERDChristmasTree = 1 +"let g:NERDChristmasTree = 1 +let g:NERDTreeQuitOnOpen = 1 +let g:NERDTreeWinPos = "right" +let g:NERDTreeWinSize = 40 +let g:NERDTreeDirArrows=0 + +let g:NERDTreeMarkBookmarks = 0 +let g:NERDTreeMinimalUI = 1 + +" * Signify +let g:signify_realtime = 1 +let g:signify_vcs_list = ['git'] +let g:signify_sign_change = '~' +let g:signify_sign_changedelete = g:signify_sign_change +let g:signify_sign_show_count = 0 +let g:signify_priority = 5 + +" * Nvim Tree +let g:nvim_tree_add_trailing = 1 +let g:nvim_tree_side = 'right' +let g:nvim_tree_width = 40 +let g:nvim_tree_quit_on_open = 1 +let g:nvim_tree_disable_window_picker = 1 +let g:nvim_tree_root_folder_modifier = ':p:.' + +" * Tagbar plugin settings +let g:tagbar_width = 40 +let g:tagbar_autofocus = 1 +let g:tagbar_autoclose = 1 +let g:tagbar_compact = 1 + +" * Taglist plugin settings (deprecated) +let Tlist_GainFocus_On_ToggleOpen = 1 +let Tlist_Use_Right_Window = 1 +let Tlist_Inc_Winwidth = 0 +let Tlist_File_Fold_Auto_Close = 1 +let Tlist_WinWidth = 40 +let Tlist_Show_One_File = 0 + +" * ConqueTerm +let g:ConqueTerm_CWInsert = 1 +let g:ConqueTerm_InsertOnEnter = 0 +let g:ConqueTerm_SendVisKey = 'ss' + +" * YouCompleteMe +let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' +let g:ycm_confirm_extra_conf = 0 +let g:ycm_key_invoke_completion = "" +let g:ycm_use_ultisnips_completer = 1 +"let g:ycm_add_preview_to_completeopt = 1 +"let g:ycm_autoclose_preview_window_after_completion = 1 + +" * UltiSnips +let g:UltiSnipsSnippetDirectories=["UltiSnips", "usnips"] +let g:UltiSnipsExpandTrigger="," +"let g:UltiSnipsJumpForwardTrigger="," +let g:UltiSnipsJumpBackwardTrigger="" + +" * MinBufExplorer +"let g:miniBufExplMapWindowNavVim = 1 +"let g:miniBufExplMapWindowNavArrows = 1 +"let g:miniBufExplMapCTabSwitchBufs = 1 +"let g:miniBufExplModSelTarget = 1 +"let g:miniBufExplForceSyntaxEnable = 1 + +" Markdown +"let g:markdown_enable_folding = 1 +let g:markdown_enable_mappings = 1 +let g:markdown_enable_spell_checking = 0 +let g:markdown_enable_input_abbreviations = 0 + +" * CommandT +let g:CommandTMaxFiles = 1000 +let g:CommandTMaxDepth = 7 + +" * vim-rooter +let g:rooter_cd_cmd="lcd" +let g:rooter_manual_only = 1 +set autochdir + +" " * FZF +let g:rg_command = ' + \ rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" + \ -g "!{.git,node_modules,vendor}/*" ' + +"\ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}" + +"command! -bang -nargs=* RipGrep call fzf#vim#grep(g:rg_command .shellescape(), 1, 0) +"command! -bang -nargs=* RipGrepCword call fzf#vim#grep(g:rg_command . "-q " . expand(''), 1, 0) + +"command! -bang -nargs=* RgRoot call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case " . shellescape(), 1, {"dir": FindRootDirectory()}) + +"let g:fzf_buffers_jump = 1 +" Empty value to disable preview window altogether +"let g:fzf_preview_window = '' + +" * VimOrganizer +" default Tag list. Will be changed in near future so +" that these are defined by config lines in each .org +" file itself, but now these are where you can change things: +" let g:org_todo_setup='TODO | DONE' +" while g:org_tag_setup is itself a string +"let g:org_tag_setup='{@home(h) @work(w) @tennisclub(t)} \n {easy(e) hard(d)} \n {computer(c) phone(p)}' +"au! BufRead,BufWrite,BufWritePost,BufNewFile *.org +"au BufEnter *.org call org#SetOrgFileType() + +" * Airline +set noshowmode +let g:airline_section_c = '%{StatuslineGit()}' +let g:airline#extensions#branch#enabled = 1 +let g:airline#extensions#syntastic#enabled = 1 +let g:airline#extensions#tagbar#enabled = 1 +let g:airline_theme="murmur" +let g:airline_left_sep = '' +let g:airline_right_sep = '' +let g:airline#extensions#syntastic#enabled = 1 +let g:airline#extensions#hunks#non_zero_only = 1 +let g:airline#extensions#whitespace#enabled = 0 +let g:airline_mode_map = { + \ '__' : '-', + \ 'n' : 'N', + \ 'i' : 'I', + \ 'R' : 'R', + \ 'c' : 'C', + \ 'v' : 'V', + \ 'V' : 'V', + \ '' : 'V', + \ 's' : 'S', + \ 'S' : 'S', + \ '' : 'S', + \ } + + +" * CtrlP +let g:ctrlp_map = ',t' +let g:ctrlp_cmd = 'CtrlP' +let g:ctrlp_working_path_mode = 'ra' +let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:15' + +" * Echodoc +let g:echodoc_enable_at_startup = 1 +"let g:echodoc#type = 'floating' +"let g:echodoc#type = 'floating' +"highlight link EchoDocFloat Pmenu + +" * Vim-Go +let g:go_fmt_command = "goimports" +"let g:go_auto_type_info = 1 +let g:go_updatetime = 300 +let g:go_bin_path = $HOME . "/.go/bin" +"let g:go_def_mode = 'gopls' +"let g:go_info_mode = 'gopls' + +let g:go_highlight_functions = 1 +let g:go_highlight_function_calls = 1 +"let g:go_highlight_variable_declarations = 1 +"let g:go_highlight_variable_assignments = 1 + +" ** STATUSLINE ** +set laststatus=2 +set statusline=%t "tail of the filename +"set statusline+=[%{&ff}] "file format +"set statusline+=%h "help file flag +set statusline+=\ %w "help file flag +set statusline+=%r "read only flag +set statusline+=%y "filetype +set statusline+=\ %m "modified flag +set statusline+=%= "left/right separator +set statusline+=%{fugitive#statusline()}\ \ +set statusline+=%c, "cursor column +set statusline+=%l/%L "cursor line/total lines +set statusline+=\ %P "percent through file + +" ** SMALL FUNCTIONS THAT DON'T FIT AS PLUGINS *** + +" Add capital W and Q so I can be lazy about my shift key +if !exists(":W") + command W :w +endif + +if !exists(":Q") + command Q :q +endif + +" CD to the path of the file I'm editing. +command Cdf :cd %:p:h + +" Print path of file +command Filepath :echo expand('%:p') + +" Save a vim session! Useful if you want to save buffer states and so on +command SaveSession :mksession! ~/.vim_last_session +command LoadSession :source ~/.vim_last_session + +" This is a quick way to edit a persistent scratch buffer for me... +command ScratchOpen :e scp://barak@barakmich.com//home/barak/notes/scratch + +" Sudo-make-me-a-sandwich write. For when I forget to be root. +"command Wdammit :w !sudo tee > /dev/null % +command Wdammit :w suda://% + + +" I can never remember markdown fully. Open me a cheatsheet +command MarkdownCheatsheet :rightb vsplit ~/.vim/markdown_cheatsheet.md + + +" Doesn't quite work right but can be a real savior if needed. +" Oh-shit-what-was-this-like-before-I-changed-it? +function! s:DiffWithSaved() + let filetype=&ft + diffthis + vnew | r # | normal! 1Gdd + diffthis + exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype +endfunction +com! DiffSaved call s:DiffWithSaved() + +" Highlight lines that are longer than textwidth for the filetype, commonly 80 +" characters. +function! HighlightTooLongLines() + highlight def link RightMargin Error + if &textwidth != 0 + exec 'match RightMargin /\%<' . (&textwidth + 3) . 'v.\%>' . (&textwidth + 1) . 'v/' + endif +endfunction + +" Toggles the quickfix window split. +command -bang -nargs=? QFix call QFixToggle(0) +function! QFixToggle(forced) + if exists("g:qfix_win") && a:forced == 0 + cclose + else + execute "copen " . 15 + endif +endfunction + +" Toggle LocationList +command -bang -nargs=? LFix call LFixToggle(0) +function! LFixToggle(forced) + if exists("g:lfix_win") && a:forced == 0 + unlet! g:lfix_win + lclose + else + execute "lopen " . 10 + let g:lfix_win = "t" + endif +endfunction + +"au FileType go nmap C (go-clearlay) +"clear overlay +command -bang -nargs=? GoCoverlayT call GoCoverlayToggle(0) +function! GoCoverlayToggle(forced) + if exists("g:go_coverlay_t") && a:forced == 0 + unlet! g:go_coverlay_t + GoClearlay + "call (go-clearlay) + else + "call (go-coverlay) + GoCoverlay + let g:go_coverlay_t = "t" + endif +endfunction + + +" Toggle GoCoverlay +au FileType go nmap c :GoCoverlayT + +" Coquille +au FileType coq nmap a :CoqToCursor +au FileType coq imap a :CoqToCursor + +" Make the Quickfix window respond well to commands (for instance, q to close, +" Enter to select, etc). In tandem with the above. +augroup QFixToggle + autocmd! + autocmd BufWinEnter quickfix let g:qfix_win = bufnr("$") + autocmd BufWinEnter quickfix exec "nnoremap q :QFix" + autocmd BufWinLeave * if exists("g:qfix_win") && expand("") == g:qfix_win | unlet! g:qfix_win | endif +augroup END + + +" Execute a command that pipes output to window. Captures output into a new, +" appropriately titled, buffer. +function! s:ExecuteInShellOutput(command) + let command = join(map(split(a:command), 'expand(v:val)')) + let winnr = bufwinnr('^' . command . '$') + silent! execute winnr < 0 ? 'botright new ' . fnameescape(command) : winnr . 'wincmd w' + setlocal buftype=nowrite bufhidden=wipe nobuflisted noswapfile wrap number + echo 'Executing ' . command . '...' + silent! execute 'silent %!'. command +" uncomment this if you want the new buffer to try to grow to accommodate the output + "silent! execute 'resize ' . line('$') + silent! redraw + silent! execute 'au BufUnload execute bufwinnr(' . bufnr('#') . ') . ''wincmd w''' + silent! execute 'nnoremap r :call ExecuteInShell(''' . command . ''')' + echo 'Execution of ' . command . ' complete.' +endfunction + +" Same as above, doesn't capture output +function! s:ExecuteInShell(command) + let command = join(map(split(a:command), 'expand(v:val)')) + silent! execute 'silent !'. command + redraw! + echo 'Execution of ' . command . ' complete.' +endfunction + +command! -complete=shellcmd -nargs=+ Shell call s:ExecuteInShellOutput() +command! -complete=shellcmd -nargs=+ Exec call s:ExecuteInShell() +command! -nargs=* Make call s:ExecuteInShellOutput('make '.) +command! -nargs=* PTW call s:ExecuteInShell('ptw post --client=vim "'..'"') +command! -nargs=* CaptureNote :AsyncRun -silent capture --viewing %:p 2>&1 > /dev/null + +" Highlight all instances of word under cursor, when idle. +" Useful when studying strange source code. +" Type z/ to toggle highlighting on/off. +nnoremap z/ :if AutoHighlightToggle()set hlselseset nohlsendif +function! AutoHighlightToggle() + let @/ = '' + if exists('#auto_highlight') + au! auto_highlight + augroup! auto_highlight + setl updatetime=4000 + echo 'Highlight current word: off' + return 0 + else + augroup auto_highlight + au! + au CursorHold * let @/ = '\V\<'.escape(expand(''), '\').'\>' + augroup end + setl updatetime=500 + echo 'Highlight current word: ON' + return 1 + endif +endfunction + +" Removes trailing spaces +function AutoTrimWhitespace() + if exists("b:auto_trim_whitespace") + if b:auto_trim_whitespace == 1 + let l:winview = winsaveview() + silent! %s/\s\+$// + call winrestview(l:winview) + endif + endif +endfunction + + +function! StatuslineGit() + let l:root = finddir('.git/..', expand('%:p:h').';') + return expand('%:p:s!'. l:root . '!/!') +endfunction + +function InstallEverything() + GoUpdateBinaries + BlackUpgrade +endfunction + +command CocReinstall :CocInstall coc-json coc-pyright coc-rust-analyzer coc-snippets coc-svelte coc-tsserver coc-ultisnips + + +autocmd FileType defx call s:defx_my_settings() +function! s:defx_my_settings() abort + " Define mappings + nnoremap + \ line('.') == 1 ? defx#do_action('cd', ['..']) : defx#do_action('open') + nnoremap c + \ defx#do_action('copy') + nnoremap m + \ defx#do_action('move') + nnoremap p + \ defx#do_action('paste') + nnoremap l + \ defx#do_action('open') + nnoremap E + \ defx#do_action('open', 'vsplit') + nnoremap P + \ defx#do_action('preview') + nnoremap o + \ defx#do_action('open_tree', 'toggle') + nnoremap K + \ defx#do_action('new_directory') + nnoremap N + \ defx#do_action('new_file') + nnoremap M + \ defx#do_action('new_multiple_files') + nnoremap C + \ defx#do_action('toggle_columns', + \ 'mark:indent:icon:filename:type:size:time') + nnoremap S + \ defx#do_action('toggle_sort', 'time') + nnoremap d + \ defx#do_action('remove') + nnoremap r + \ defx#do_action('rename') + nnoremap ! + \ defx#do_action('execute_command') + nnoremap x + \ defx#do_action('execute_system') + nnoremap yy + \ defx#do_action('yank_path') + nnoremap . + \ defx#do_action('toggle_ignored_files') + nnoremap ; + \ defx#do_action('repeat') + nnoremap h + \ defx#do_action('cd', ['..']) + nnoremap ~ + \ defx#do_action('cd') + nnoremap q + \ defx#do_action('quit') + nnoremap + \ defx#do_action('toggle_select') . 'j' + nnoremap * + \ defx#do_action('toggle_select_all') + nnoremap j + \ line('.') == line('$') ? 'gg' : 'j' + nnoremap k + \ line('.') == 1 ? 'G' : 'k' + nnoremap + \ defx#do_action('redraw') + nnoremap + \ defx#do_action('print') + nnoremap cd + \ defx#do_action('change_vim_cwd') +endfunction + + +" ** KEY REMAPPINGS ** +" +" I used to use tabs, but then I took an arrow to the knee. +" Tabs in vim suck because they aren't what you want. Use tabbar. +"nnoremap gc :tabnew +"nnoremap gK :tabclose +"nnoremap gn gt +"nnoremap gp gT + +" I don't know how I came up with gt for opening the tree, but it stuck. +"nmap gt :NERDTreeToggle +"nmap gt :VimFilerExplorer -winwidth=40 -toggle -direction=rightbelow -parent -status -force-hide +"nmap gt :VimFiler -status -auto-cd -parent -force-quit +"nmap gt :Defx `escape(expand('%:p:h'), ' :')` -search=`expand('%:p')` -columns=icons:indent:filename:type +nmap gt :edit . +""nnoremap gt :NvimTreeToggle +" The same for the TagList, useful for large C files. +"nmap gb :TlistToggle +nmap gb :TagbarToggle +"nnoremap gx :Kwbd +" :Kwbd (defined below) really kills a buffer dead, and closes the window. +" gK is similar. +nnoremap gc :Kwbd +"nnoremap gc :bdelete +"nnoremap gK :bdelete! + +" I use gn/gp to cycle through open tabs/buffers +nnoremap gn :bn +nnoremap gp :bp +nnoremap gz :pclose +" The single most handy way to get around a file. Cursor over a word, and then +" type g* -- you'll go to the next instance of that word in the file. Make it +" easier to reach by calling it gw (go-word) instead of hidden away. +nnoremap gw g* +" Make shift-p like p except, put the line above instead of below. +nmap P op +" Line-based movement is cute, but it's tricky for files with lines that wrap. +" Attune more to what you see on the screen instead of where the lines actually +" are. +nnoremap j gj +nnoremap k gk +xnoremap j gj +xnoremap k gk +nnoremap gj +nnoremap gk +xnoremap gj +xnoremap gk +inoremap gj +inoremap gk +"nnoremap +" Years of using bash and zsh have caused my fingers to expect these Emacs-like +" mappings to exist. Make them exist in vim as well. But eye them with +" suspicion, as they come from Emacs. +nnoremap ^ +nnoremap $ +xnoremap ^ +xnoremap $ +inoremap ^ +inoremap $ + +" Dealing with split windows is a pain. Make it less of a pain, by making +" Ctrl-direction appropriate. +"nnoremap j +"nnoremap k +"nnoremap l +"nnoremap h +""nnoremap w +""nnoremap W +"inoremap j +"inoremap k +"inoremap l +"inoremap h + +"if has('nvim') + "tnoremap + "tnoremap j + "tnoremap k + "tnoremap l + "tnoremap h +"endif + +" Make it easier to clear highlighting, with no functionality penalty +nnoremap :noh + +" Better fold mappings +nnoremap @=(foldlevel('.')?'za':'l') +vnoremap zf +" Just to be handy, Ctrl-C acts like escape. So does jj, which never really +" comes up in practice. If you really need to type jj do so slowly. +imap +inoremap jj + +" Leader key functions +" See quickfix. +"nnoremap ff :LFix +" See quickfix. +nnoremap ss :SyntasticSetLoclist +" Next quickfix. +nnoremap fn :lnext +" Prev quickfix. +nnoremap fp :lprev +"nnoremap aa :Denite -mode=normal -buffer-name=search-buffer grep +nnoremap ac :Denite -resume -buffer-name=search-buffer grep +"nnoremap aw :DeniteCursorWord -buffer-name=search-buffer grep +" +nnoremap nn :CaptureNote +call denite#custom#map('insert', '', '') +"call denite#custom#var('grep', 'command', ['rg']) +"call denite#custom#var('grep', 'default_opts', + "\ ['--no-heading', '--color', 'never', '--smart-case']) +"call denite#custom#var('grep', 'recursive_opts', []) +"call denite#custom#var('grep', 'pattern_opt', []) +"call denite#custom#var('grep', 'separator', ['--']) +"call denite#custom#var('grep', 'final_opts', []) +"call denite#custom#option('search-buffer', 'highlight_matched_char', 'deniteMatchedChar') +call denite#custom#var('grep', { + \ 'command': ['rg'], + \ 'default_opts': ['-i', '--vimgrep', '--no-heading'], + \ 'recursive_opts': [], + \ 'pattern_opt': ['--regexp'], + \ 'separator': ['--'], + \ 'final_opts': [], + \ }) +"nnoremap g :Denite -buffer-name=search-buffer grep +"nnoremap aa :RipGrep! +nnoremap aa :RgRoot! +"nnoremap aw :RgRoot! +"nnoremap :Files! `git rev-parse --show-toplevel` +"nnoremap :GFiles +nnoremap lua require('telescope.builtin').git_files{} +nnoremap ag lua require('telescope.builtin').live_grep{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1], search = ''} +nnoremap aw lua require('telescope.builtin').grep_string{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1]} +nnoremap q lua require('telescope.builtin').quickfix{} +nnoremap ff lua require('telescope.builtin').quickfix{} + +" For C++ -- A is a great plugin which allows you to jump from the c file to the +" header and vice-versa. Mneumonic here is headerheader. +nnoremap hh :A +" CommandT is useful, but if I'm juggling lots of buffers, limit it to another +" one I have open (instead of standard t). +"nnoremap o :Buffers +nnoremap o lua require('telescope.builtin').buffers{initial_mode = "insert"} +nnoremap lua require('telescope.builtin').buffers{prompt_prefix = " "} +"nnoremap j +"nnoremap p :PTW +nnoremap p :LustyJugglePrevious +nnoremap jd :YcmCompleter GoToDefinitionElseDeclaration +nnoremap mm :w:make! + +" ** EXTRA INCLUDES ** +" +let s:extrarc = expand($HOME . '/.vimrc_google') +if filereadable(s:extrarc) + exec ':so ' . s:extrarc +endif + +" ** SEE ALSO ** +" filetype.vim + +"call remote#host#RegisterPlugin('python3', '/home/barak/.vim/bundle/deoplete.nvim/rplugin/python3/deoplete', [ + "\ {'sync': v:true, 'name': '_deoplete', 'type': 'function', 'opts': {}}, + "\ ]) +" +if !empty($VIRTUAL_ENV) +" let g:python_host_prog = $VIRTUAL_ENV . '/bin/python' +" let g:python3_host_prog = $VIRUTAL_ENV . '3/bin/python' +endif + +autocmd FileType denite call s:denite_my_settings() +function! s:denite_my_settings() abort + nnoremap + \ denite#do_map('do_action') + "nnoremap d + "\ denite#do_map('do_action', 'delete') + "nnoremap p + "\ denite#do_map('do_action', 'preview') + nnoremap q + \ denite#do_map('quit') + nnoremap i + \ denite#do_map('open_filter_buffer') + nnoremap + \ denite#do_map('toggle_select').'j' +endfunction + +map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" + +function! Syn() + for id in synstack(line("."), col(".")) + echo synIDattr(id, "name") + endfor +endfunction +map command! -nargs=0 Syn call Syn() + +" Final hi links for TreeSitter + +hi link @type.rust TSCSecondaryTypeParam + +let s:gptool_temp = expand($HOME . '/src/gptool/bindings.vim') +if filereadable(s:gptool_temp) + exec ':so ' . s:gptool_temp +endif diff --git a/dot_yarnrc b/dot_yarnrc new file mode 100644 index 0000000..ff3638e --- /dev/null +++ b/dot_yarnrc @@ -0,0 +1,6 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +lastUpdateCheck 1711242871592 +prefix "/home/barak/.yarn"