diff --git a/.gitignore b/.gitignore index ede9b22..62a1354 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ existing minimal -install_local.sh -config/i3/config.de -config/i3/config.local config/gtk-3.0/bookmarks config/xfce4/xfconf/xfce-perchannel-xml config/xfce4/terminal config/themes config/icons -packages/*.local diff --git a/config/i3/config.d/theme.conf b/config/i3/config.d/theme.conf index 93da93d..21f4982 100644 --- a/config/i3/config.d/theme.conf +++ b/config/i3/config.d/theme.conf @@ -8,7 +8,8 @@ font pango: Liberation Sans Regular 10 default_border pixel 5 # thin borders -# hide_edge_borders both +hide_edge_borders smart +smart_borders on # Set inner/outer gaps gaps inner 10 diff --git a/config/i3/config.d/workspace.conf b/config/i3/config.d/workspace.conf index 33c6331..ab0fcc3 100644 --- a/config/i3/config.d/workspace.conf +++ b/config/i3/config.d/workspace.conf @@ -26,3 +26,5 @@ workspace_layout default #workspace $ws2 output DP-4 #workspace $ws4 output DP-4 #workspace $ws6 output DP-4 + +exec i3-msg workspace 2 diff --git a/config/i3/config.de/i3-bar.conf b/config/i3/config.de/i3-bar.conf new file mode 120000 index 0000000..5697b3d --- /dev/null +++ b/config/i3/config.de/i3-bar.conf @@ -0,0 +1 @@ +/home/brad/dotfiles/config/plasma-i3/i3-bar.conf \ No newline at end of file diff --git a/config/i3/config.de/i3-keybindings.conf b/config/i3/config.de/i3-keybindings.conf new file mode 120000 index 0000000..b2115dc --- /dev/null +++ b/config/i3/config.de/i3-keybindings.conf @@ -0,0 +1 @@ +/home/brad/dotfiles/config/plasma-i3/i3-keybindings.conf \ No newline at end of file diff --git a/config/nvim/config/bindings-vimwiki.lua b/config/nvim/config/bindings-vimwiki.lua new file mode 100644 index 0000000..a773077 --- /dev/null +++ b/config/nvim/config/bindings-vimwiki.lua @@ -0,0 +1,78 @@ +vim.cmd([[ +function! MapVimwiki() + " grep: if exists('g:loaded_vimwiki') + " double m + nmap mm VimwikiIndex + " m wiki + nmap mw VimwikiUISelect + " m help + nmap mhelp :verbose map ,m + " m go + nmap mg VimwikiGoto + " m personal + nmap mf VimwikiUISelect1 + " m work + nmap m VimwikiUISelect2 + " m private + nmap mp VimwikiUISelect3 + " m shared + nmap ms VimwikiUISelect4 + + " and (the original bindings for these) don't work + " because they send the same keycode and probably other reasons + nmap m- VimwikiSplitLink + nmap m VimwikiVSplitLink + + nmap mnt VimwikiNextTask + " TODO This command doesn't exist + " nmap mN VimwikiPrevTask + nmap mnl VimwikiNextLink + nmap mNl VimwikiPrevLink + " nmap m/ VimwikiSearch / + " nmap maq ZettelOpen + nmap VimwikiIncreaseLvlSingleItem + nmap VimwikiDecreaseLvlSingleItem + imap VimwikiIncreaseLvlSingleItem + imap VimwikiDecreaseLvlSingleItem + vmap VimwikiIncreaseLvlSingleItem + vmap VimwikiDecreaseLvlSingleItem + " This is how to map insert mode plug commands {command}a + " This always jumps to the end of the line, but with 'a' it doesn't skip + " the [ ] when adding at the start of the line + imap VimwikiToggleListItemA + nmap VimwikiRemoveSingleCB + imap VimwikiRemoveSingleCBa + nmap mb VimwikiBackLinks + " nmap m\ VimwikiTable + nmap mqtoc VimwikiTOC + nmap mqgtl VimwikiRebuildTagsVimwikiGenerateTagLinks + + " Insert link from system clipboard + vmap mk c[]Pea()"+P + imap mk viWea + nmap mk ciw[]Pea()"+P + + " TODO: None of these work + " nmap m| :VimwikiVSplitLink 1 1 + " nmap m- :VimwikiSplitLink 1 1 + " vmap m- :VimwikiSplitLink 1 1 + + " Vim-Zettel + " TODO The syntax is correct but broken + " autocmd Filetype vimwiki nmap mag ZettelOpen + autocmd Filetype vimwiki nmap mag :ZettelOpen + " autocmd Filetype vimwiki nmap mp0 :ZettelOpenp0 + " autocmd Filetype vimwiki nmap mp1 :ZettelOpenp1 + " TODO This doesn't work + autocmd Filetype vimwiki nmap mat :ZettelOpentitle: +endfunction + +augroup Vimwiki_Mappings + autocmd! + " TODO: This isn't working, vimwiki bindings are not being initialized + autocmd FileType vimwiki :call MapVimwiki() +augroup END +" TODO This shouldn't be necessary, why does this need to be called before vimwiki +" and after startup? +" :call MapVimwiki() +]]) diff --git a/config/nvim/config/bindings.lua b/config/nvim/config/bindings.lua new file mode 100644 index 0000000..c932fab --- /dev/null +++ b/config/nvim/config/bindings.lua @@ -0,0 +1,191 @@ +vim.cmd([[ +" --- Mappings --- +" Explanation of mapping commands: https://stackoverflow.com/a/3776182 +" - General - +" TODO: Remap this to easymotion but don't step on other bindings +" noremap : +inoremap ,, +cnoremap ,, +nmap j gj +nmap k gk +" Only set on first run or it overwrites YCM behavior +" if has('vim_starting') +" imap +" endif +let mapleader="," +let maplocalleader="\\" +" Clear highlighting on ,, in normal mode +map :nohl +" Enable hex mode +map \he :%!xxd +" Disable hex mode +map \hd :%!xxd -r +" Show whitespace +nmap lw :set list! +" List registers +map lr :reg +" List marks +map lm :marks +" Close buffer +map c :Bclose +" Prev/next buffer +map q :bp +map w :bn +" System clipboard cut copy paste +map y "+y +map Y "+Y +map p "+p +map P "+P +map x "+x +map dd "+dd +" Line break above +" TODO urxvt (and other ttys) treat C-CR, S-CR, and CR as the same input +" imap Bkki +" Move between splits +nnoremap +nnoremap +nnoremap +nnoremap +" Make split +nnoremap - :sp +nnoremap :vsp +set splitbelow +set splitright +" Open vimrc +map v :e $MYVIMRC +" Set working directory to current file directory +map cd :cd %:p:h:pwd:NERDTreeCWD:NERDTreeToggle +" Update vimrc +map rr :call ReloadVimRC(); +" Open GVim menu +" map m :emenu +" Low-light mode +map ll :set background=dark +" Daylight mode +map LL :set background=light +" Open ranger +nmap ra :call Ranger() +" Delete whitespace +nmap rw :call DeleteTrailingWS() +" Fix syntax highlighting +noremap :syntax sync fromstart + + +function! MapPlugins() + " - Plugins - + if exists('g:loaded_startify') + " Open Startify + map o :Startify + endif + + if exists('g:loaded_nerd_tree') + " Toggle directory view + map t :NERDTreeToggle + endif + + " Generative AI + + if exists('g:loaded_tagbar') + " Toggle tagbar + map ct :TagbarToggle + endif + + if exists('g:loaded_vimwiki') + " TODO This shouldn't be necessary! + " NOTE: Changes must be mirrored to config/bindings-vimwiki.vimrc! + endif + + if exists('g:loaded_table_mode') + endif + + if exists('g:loaded_zettel') + let g:zettel_default_mappings = 0 + endif + + " Update ctags + " nnoremap ct :! ctags -R + + if exists('g:loaded_ctrlp') + " Jump to a tag + nnoremap . :CtrlPTag + " Jump to a buffer + nnoremap ; :CtrlPBuffer + endif + + " Make a config for YCM from Makefile + map ygc :YcmGenerateConfig + + " Ag + map ag :Ag + + " Easymotion + if exists('g:EasyMotion_loaded') + " let g:EasyMotion_do_mapping = 0 + let g:EasyMotion_smartcase = 1 + map / (easymotion-sn) + omap / (easymotion-tn) + " map n (easymotion-next) + " map N (easymotion-prev) + " Bidirectional single-letter search + map s (easymotion-s) + " Bidirectional 2-letter search + map s (easymotion-s2) + " Forward single letter search + map f (easymotion-f) + " Directional jumps + map l (easymotion-lineforward) + map j (easymotion-j) + map k (easymotion-k) + map h (easymotion-linebackward) + endif + + " Multiple Cursors + let g:multi_cursor_use_default_mapping=0 + let g:multi_cursor_next_key='n' + let g:multi_cursor_prev_key='m' + let g:multi_cursor_skip_key='.' + let g:multi_cursor_quit_key=',' + let g:multi_cursor_start_key='' + + if exists('g:tabular_loaded') + " Tabular + map a= :Tabularize /= + map a: :Tabularize /:\zs + endif + + if exists('g:loaded_nerd_comments') + " NERD Commenter + " Enter the NERD Commenter menu which can be tabbed through + map nc :emenu Plugin.comment. + endif + + if exists('g:loaded_gundo') + " Gundo + nnoremap u :GundoToggle + endif + + " --- Language Specific --- + " - General + " COC + " Use K to show documentation in preview window + nnoremap K :call ShowDocumentation() + + nmap ff (coc-format-selected) + nmap rn (coc-rename) + nmap gd (coc-definition) + nmap gy (coc-type-definition) + nmap gi (coc-implementation) + nmap gr (coc-references) + + " - Rust - + map rr :RustRun + + " - Markdown - + map v :LivedownToggle +endfunction + +augroup Plugin_Mappings + autocmd! + autocmd VimEnter * :call MapPlugins() +augroup END +]]) diff --git a/config/nvim/config/bindings.vimrc b/config/nvim/config/bindings.vimrc index 02b9bf7..3f49a6b 100644 --- a/config/nvim/config/bindings.vimrc +++ b/config/nvim/config/bindings.vimrc @@ -82,6 +82,8 @@ function! MapPlugins() map t :NERDTreeToggle endif + " Generative AI + if exists('g:loaded_tagbar') " Toggle tagbar map ct :TagbarToggle diff --git a/config/nvim/config/functions.lua b/config/nvim/config/functions.lua new file mode 100644 index 0000000..98c2137 --- /dev/null +++ b/config/nvim/config/functions.lua @@ -0,0 +1,62 @@ +vim.cmd([[ +"------ Functions ------ +if executable('ranger') + " Open ranger from within vim + function! Ranger() + " Get a temp file name without creating it + let tmpfile = substitute(system('mktemp -u'), '\n', '', '') + " Launch ranger, passing it the temp file name + silent exec '!RANGER_RETURN_FILE='.tmpfile.' ranger' + " If the temp file has been written by ranger + if filereadable(tmpfile) + " Get the selected file name from the temp file + let filetoedit = system('cat '.tmpfile) + exec 'edit '.filetoedit + call delete(tmpfile) + endif + redraw! + endfunction +endif + + " set viminfo=%M + +" Delete trailing white space on save, useful for Python and CoffeeScript ;) +func! DeleteTrailingWS() + silent! normal mz + silent! %s/\s\+$//ge + silent! normal `z +endfunc +" autocmd BufWrite *.py :call DeleteTrailingWS() +" autocmd BufWrite *.coffee :call DeleteTrailingWS() + +" Only define if not defined, otherwise it'll be redefined in the middle of +" execution +if !exists("*ReloadVimRC") + func! ReloadVimRC() + " IMPORTANT: After way too much messing with this trying to make everything work properly + " after a vimrc reload, my advice is DON'T RELOAD THE VIMRC WHILE EDITING A FILE! + " Side effects will include: Some syntax highlighting lost until next save, indentline + " plugin will break, newly opened buffers will use buffer reloaded on's syntax file for + " comment plugins (and possibly other things) + " Ommision of 'syntax on' here will prevent anything from breaking inside the current buffer, + " however new buffers will be opened without any syntax highlighting + source $MYVIMRC + " Need to toggle this twice, once toggles every other time, none turns + " it off on reload. I have no idea why this is. + RainbowToggle + RainbowToggle + syntax on + " Workaround for indentline turning off on syntax enable + IndentLinesReset + endfunc +endif + +" COC Show Documentation under cursor +function! ShowDocumentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif +endfunction +]]) diff --git a/config/nvim/config/general.lua b/config/nvim/config/general.lua new file mode 100644 index 0000000..228af83 --- /dev/null +++ b/config/nvim/config/general.lua @@ -0,0 +1,164 @@ +vim.cmd([[ +" Needed for vimwiki +set nocompatible +filetype plugin on +syntax on + +" Control-X Control-O to open autocomplete box +set omnifunc=syntaxcomplete#Complete +" Leave hidden buffers open +set hidden +set autoread " Reload files changed outside vim + +" Turn off .swp files +set noswapfile +set nobackup + +set t_Co=256 " Run in 256-color mode +set number " Show line numbers + +" Set the clipbaord +" set clipboard+=unnamedplus +" let g:clipboard = { +" \ 'name': 'myClipboard', +" \ 'copy': { +" \ '+': 'tmux load-buffer -', +" \ '*': 'tmux load-buffer -', +" \ }, +" \ 'paste': { +" \ '+': 'tmux save-buffer -', +" \ '*': 'tmux save-buffer -', +" \ }, +" \ 'cache_enabled': 1, +" \ } +" let g:loaded_clipboard_provider=1 + + +" Matchit plugin enhances % +runtime macros/matchit.vim + +" Set unix line endings +" set fileformat=unix + +" Set encoding for vim-devicons +set encoding=UTF-8 + +" Don't redraw screen when not needed +set lazyredraw + +" Allow backspacing over everything +set backspace=indent,eol,start + +" Keep longer history +set history=700 + +" Incremental search +set incsearch + +" Smart case insensitive search +set ignorecase +set smartcase + +" Maintain context around cursor +set scrolloff=15 + +" Wildmode configuration +set wildmode=longest,list,full +set wildmenu +" Make hardcoded tab work +:set wildcharm= + +" Mouse support +set mouse=a + +" Configure tab behavior +set tabstop=4 +set softtabstop=4 +set expandtab +set shiftwidth=4 +" set autoindent +set cindent +set cinkeys-=0# +set indentkeys-=0# +" set smartindent + +" Linewrap +set wrap linebreak nolist + +" Show current position +set ruler + +" Show matching brackets +set showmatch + +" Make conceals less of an issue to edit by expanding on cursor +let g:indentLine_concealcursor="" +let g:indentLine_conceallevel=2 + +" Code folding +set foldmethod=syntax +set foldcolumn=5 +set foldlevel=2 +set foldlevelstart=2 +let g:vimwiki_folding='list' +let g:markdown_folding=1 + +" Make views automatic (they store folds) +set viewoptions-=options +" TODO: These caused all of my buffers to cycle on buffer operations and +" slowed things down +" autocmd BufWinLeave * if expand("%") != "" | silent! mkview! | endif +" autocmd BufWinEnter * if expand("%") != "" | silent! loadview | endif + +" Don't open empty buffer when starting existing session +set shortmess+=I + +" Load default menus +source $VIMRUNTIME/menu.vim + +" Always display airline statusline +set laststatus=2 +" Hide default statusline text +set noshowmode " + +" Theme +" colorscheme zenburn +" colorscheme solarized +" colorscheme base16-default +" colorscheme hybrid_reverse +" colorscheme hybrid_material +try + silent! colorscheme gruvbox +catch /^Vim\%((\a\++)\)\=:E185/ + colorscheme desert +endtry + +set termguicolors + +let g:enable_bold_font = 1 + +" Have vrm extend background color to full terminal screen +set t_ut= + +" --- GUI settings --- +" set lines=50 +" set columns=150 + +" --- Language specific settings --- +" autocmd! BufNewFile,BufReadPre,FileReadPre,BufEnter * set expandtab softtabstop=4 shiftwidth=4 +augroup Enter_Buffer + autocmd! + autocmd BufNewFile,BufReadPre,FileReadPre,BufEnter *.pde setlocal softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufReadPre,FileReadPre,BufEnter Makefile setlocal noexpandtab softtabstop=0 shiftwidth=8 + autocmd BufNewFile,BufReadPre,FileReadPre,BufEnter *.asm,*.S setlocal softtabstop=8 shiftwidth=8 +augroup END + +au BufNewFile,BufRead *.py +\ setlocal tabstop=4 | +\ setlocal softtabstop=4 | +\ setlocal shiftwidth=4 | +\ setlocal textwidth=79 | +\ setlocal expandtab | +\ setlocal autoindent | +\ setlocal fileformat=unix | +]]) diff --git a/config/nvim/config/init.lua b/config/nvim/config/init.lua new file mode 100644 index 0000000..03a5b7c --- /dev/null +++ b/config/nvim/config/init.lua @@ -0,0 +1,187 @@ +vim.cmd([[ +let g:vim_plug_install_dir = "~/.local/share/nvim/site/autoload" +let g:plugin_install_dir = "~/.local/share/nvim/plugged" + +" Install vim-plug if not present +if empty(glob(g:vim_plug_install_dir . "/plug.vim")) + execute "!curl -fLo " . g:vim_plug_install_dir . "/plug.vim " + \ "--create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" +endif + +call plug#begin('~/.vim/plugged') + +" --- General --- +" - Visual - +" Rainbow parentheses +Plug 'luochen1990/rainbow' +" Gruvbox +Plug 'morhetz/gruvbox' +" Airline +" TODO This now depends on lua +Plug 'bling/vim-airline' + +" - Views - +" Start screen +Plug 'mhinz/vim-startify' +" Directory view +Plug 'scrooloose/nerdtree' +" Visualize undo tree +Plug 'sjl/gundo.vim' +" Much nicer buffer management +Plug 'jlanzarotta/bufexplorer' +" Shows indentation level +Plug 'yggdroot/indentLine' +" Show marks +" TODO Make this not conflict with ,mm for vimwiki, probably just an issue +" with not having vimwiki installed yet +" Plug 'kshenoy/vim-signature' +" +" - Sessions - +" Better sessions +Plug 'tpope/vim-obsession' + +" - Generative AI - +Plug 'David-Kunz/gen.nvim' + +" - Ctags - +" Ctags view +Plug 'majutsushi/tagbar' +" Automatically keep ctags up to date +" Plug 'xolox/vim-easytags' +" TODO Fix compatibility with vim-zettel +" Plug 'c0r73x/neotags.nvim' + +" - Syntax and completion - +" Asynchronous linting +Plug 'neomake/neomake' +" Completion +Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" Awesome autocompletion for almost everything +" Plug 'Valloric/YouCompleteMe', { + " \ 'build' : { + " \ 'mac' : './install.sh --clang-completer --system-libclang --omnisharp-completer --racer-completer', + " \ 'unix' : './install.sh --clang-completer --system-libclang --omnisharp-completer --racer-completer', + " \ 'windows' : './install.sh --clang-completer --system-libclang --omnisharp-completer --racer-completer', + " \ 'cygwin' : './install.sh --clang-completer --system-libclang --omnisharp-completer --racer-completer' + " \ } + " \ } + +" - Commenting - +" Comment toggling with lots of options +Plug 'scrooloose/nerdcommenter' +" Simple, quick commenting +Plug 'tpope/vim-commentary' + +" - Git - +" Shows git changes in the side gutter +" Plug 'airblade/vim-gitgutter' +Plug 'mhinz/vim-signify' +" Git wrapper inside vim +Plug 'tpope/vim-fugitive' + +" - Automation - +" Surround things and change surroundings +Plug 'tpope/vim-surround' +" Parentheses and bracket auto-close +Plug 'Raimondi/delimitMate' +" Much nicer navigation +" TODO Move this to space key +Plug 'easymotion/vim-easymotion' +" Multiple cursors +Plug 'terryma/vim-multiple-cursors' +" Automatic alignment +Plug 'godlygeek/tabular' +" Tables +Plug 'dhruvasagar/vim-table-mode' + +" - Search - +" Kickass fuzzy finder for whole filesystem +Plug 'ctrlpvim/ctrlp.vim' +" Can use Ag from vim +" Plug 'rking/ag.vim' + +" - Utility and dependencies +" Library required for some plugins +" Plug 'L9' +" Close buffers +Plug 'rbgrouleff/bclose.vim' +" Seamless navigation between tmux panes and vim splits +Plug 'christoomey/vim-tmux-navigator' +" Required for easytags +Plug 'xolox/vim-misc' +" Make . work for plugins +Plug 'tpope/vim-repeat' +" Auto reload changed config +Plug 'xolox/vim-reload' +" Make configuration files for YCM +" Plug 'rdnetto/YCM-Generator' + +" - Note Taking - +" Note taking and wiki managment +Plug 'vimwiki/vimwiki' +" TODO Why can't these go in Search? +Plug 'junegunn/fzf' +Plug 'junegunn/fzf.vim' +Plug 'michal-h21/vim-zettel' +" TODO Make this pull on buffer open / load +" Plug 'michal-h21/vimwiki-sync' + +" --- Language specific --- +" - All - +Plug 'sheerun/vim-polyglot' +" Integration with language servers but manual configuration +Plug 'neoclide/coc.nvim', {'branch': 'release'} +" Allows vim to configure filetype by file section (for svelte) +Plug 'Shougo/context_filetype.vim' +" Prettier +Plug 'prettier/vim-prettier', { + \ 'do': 'npm install', + \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'svelte', 'yaml', 'html'] } + +" - Web - +Plug 'mattn/emmet-vim' +Plug 'mattn/webapi-vim' +Plug 'cakebaker/scss-syntax.vim' + +" - Python - +" Plug 'klen/python-mode' +" Plug 'davidhalter/jedi-vim' +" Completion +" Plug 'zchee/deoplete-jedi' + +" - C# - +" Omnicompletion and syntax +" Plug 'OmniSharp/omnisharp-vim' + +" - Rust - +" Syntax and autocompletion +" Plug 'rust-lang/rust.vim' +" Plug 'phildawes/racer' + +" - Javascript - +Plug 'pangloss/vim-javascript' + +" - Typescript - +Plug 'HerringtonDarkholme/yats.vim' +" TODO: Needs to be installed with `:CocInstall coc-tsserver`, figure out how +" to config this +" Plug 'coc-extensions/coc-tsserver' + +" - Svelte +" Plug 'evanleck/vim-svelte', {'branch': 'main'} +Plug 'leafOfTree/vim-svelte-plugin' +Plug 'coc-extensions/coc-svelte' + +" - Processing - +Plug 'sophacles/vim-processing' + +" - Markdown - +" Plug 'shime/vim-livedown' + + +" --- Icons --- +" For some reason this needs to be loaded last +Plug 'ryanoasis/vim-devicons' + +call plug#end() +]]) diff --git a/config/nvim/config/init.vimrc b/config/nvim/config/init.vimrc index c2c9e06..01b2a28 100644 --- a/config/nvim/config/init.vimrc +++ b/config/nvim/config/init.vimrc @@ -39,6 +39,9 @@ Plug 'yggdroot/indentLine' " Better sessions Plug 'tpope/vim-obsession' +" - Generative AI - +Plug 'David-Kunz/gen.nvim' + " - Ctags - " Ctags view Plug 'majutsushi/tagbar' diff --git a/config/nvim/config/plugin.lua b/config/nvim/config/plugin.lua new file mode 100644 index 0000000..38a47a6 --- /dev/null +++ b/config/nvim/config/plugin.lua @@ -0,0 +1,333 @@ +require('gen').setup({ + model = "phi", + host = "10.0.2.11", + port = "11434" +}) +vim.cmd([[ +" Table of Contents +" --- General --- +" - Visual - +" - Views - +" - +" TODO + +" --- General --- +" - Sessions - +" Create new session optionally with given name. These show up in Startify +command -nargs=? SessionNew :Obsess ~/.local/share/nvim/session/ +command -nargs=0 SessionEnd :Obsess! +command -nargs=1 SessionLoad :source ~/.local/share/nvim/session/ +" TODO Could use g:startify_session_persistence and just rely on that + +" - Visual - +set background=dark +let base16colorspace=256 +" let g:solarized_termtrans = 3 + +" Airline +let g:airline_powerline_fonts=1 +" PERF: Could cause bad performance +" let g:airline_skip_empty_sections=1 +let g:airline#extensions#tabline#enabled=1 +" Modify the statusbar if a recording is in session +" TODO: This prevents some extensions (tagbar, virtualenv) from using the +" section +" TODO: Only if Obsession installed! +let g:airline_section_x='%{ObsessionStatus("Session Recording |", "")} %{&filetype}' + +" Gruvbox +let g:gruvbox_italic=1 +let g:gruvbox_contrast_dark="medium" +let g:gruvbox_contrast_light="soft" +let g:gruvbox_invert_selection=1 +let g:gruvbox_invert_signs=0 +let g:gruvbox_improved_strings=0 +let g:gruvbox_improved_warnings=1 +let g:gruvbox_italicize_strings=1 + +" Rainbow parentheses +" if exists('g:rainbow_conf') +" augroup Rainbow_Parentheses +" autocmd! +" autocmd VimEnter * if exists('g:rainbow_conf') | +" \ RainbowToggle | +" \ endif +" augroup END +" endif + +" - Views - +" Startify +let g:startify_bookmarks = [ + \"~/dotfiles/config/nvim/config/init.vimrc", + \"~/dotfiles/config/nvim/config/general.vimrc", + \"~/dotfiles/config/nvim/config/plugin.vimrc", + \"~/dotfiles/config/nvim/config/bindings.vimrc", + \"~/dotfiles/config/nvim/config/functions.vimrc", + \"~/dotfiles/zshrc", + \"~/dotfiles/config/i3/config" + \] +let g:startify_custom_indices = ['f', 'd', 's', 'a', 'g'] +let g:startify_custom_header = map(split(system('fortune -a -s | fmt -80 -s | cowthink -$(shuf -n 1 -e b d g p s t w y) -f $(shuf -n 1 -e $(cowsay -l | tail -n +2)) -n'), '\n'), '" ". v:val') + [","] +" let g:startify_lists = [ +" \ { 'type': 'files', 'header': [' MRU'] }, +" \ { 'type': 'dir', 'header': [' MRU '. getcwd()] }, +" \ { 'type': 'sessions', 'header': [' Sessions'] }, +" \ { 'type': 'bookmarks', 'header': [' Bookmarks'] }, +" \ { 'type': 'commands', 'header': [' Commands'] }, +" \ ] + +" Automatically open tagbar when entering supported buffer +" autocmd BufEnter * nested :call tagbar#autoopen(0) + +" - Generative AI - + +" - Utility - +" DelimitMate sane bracing +let delimitMate_expand_cr = 1 + +" Indent Guide configuration +" set ts=2 sw=2 et +let g:indent_guides_enable_on_vim_startup = 0 +let g:indent_guides_start_level = 2 +let g:indent_guides_auto_colors = 0 +augroup Indent_Guides + autocmd! + autocmd VimEnter,Colorscheme * if exists('g:indentLine_loaded') | + \ :hi IndentGuidesOdd ctermbg=darkgreen | + \ endif + autocmd VimEnter,Colorscheme * if exists('g:indentLine_loaded') | + \ :hi IndentGuidesEven ctermbg=cyan | + \ endif +augroup END + +" Indent Line configuration +let g:indentLine_faster = 1 +" let g:indentLine_leadingSpaceEnabled = 1 +" let g:indentLine_leadingSpaceChar = '.' + +" GitGutter +let g:gitgutter_map_keys = 0 + +" NERD Commenter +" let g:NERDMenuMode = 1 + +" NERD Tree +" This causes an extra buffer to open when nvim starts +" augroup DIRCHAANGE +" au! +" autocmd DirChanged global :NERDTreeCWD +" augroup END + +" Sort by modification date +let NERDTreeSortOrder = ['[ [-timestamp] ]'] + +" Ctrl-P configuration +" Use nearest version control directory as cwd +let g:ctrlp_working_path_mode = 'r' + +" Syntastic configuration +let g:syntastic_aggregate_errors = 1 + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 +let g:syntastic_mode_map = { + \ "mode": "active", + \ "passive_filetypes": ['asm', 'scss'] } + +" YCM configuration +let g:ycm_global_ycm_extra_conf = '~/dotfiles/.ycm_extra_conf.py' +let g:ycm_extra_conf_globlist = ['~/dotfiles/.ycm_extra_conf.py'] + +let g:ycm_server_keep_logfiles = 1 +let g:ycm_server_log_level = 'debug' +" let g:loaded_youcompleteme = 1 +" let g:ycm_min_num_of_chars_for_completion = 100 +let g:neobundle#install_process_timeout = 1500 +" nnoremap zy :let g:ycm_auto_trigger=0 +" nnoremap zY :let g:ycm_auto_trigger=1 + +" Powerline configuration +let g:powerline_pycmd = "py" +" let g:powerline_pyeval = "pyeval" + +" Neotags configuration +" let g:neotags_enabled = 1 + +" Vimwiki configuration +let g:vimwiki_list = [ + \{'path': '~/synced-notebooks/bradwiki/', 'syntax': 'markdown', 'ext': '.md', 'diary_rel_path': 'daily_notes/', 'diary_index': 'index', 'diary_header': 'Daily Notes', 'auto_tags': 1, 'auto_diary_index': 1, 'auto_generate_links': 1, 'auto_generate_tags': 1}, + \{'path': '~/synced-notebooks/work_notebook/', 'syntax': 'markdown', 'ext': '.md', 'diary_rel_path': 'daily_notes/', 'diary_index': 'index', 'diary_header': 'Daily Notes', 'auto_tags': 1, 'auto_diary_index': 1, 'auto_generate_links': 1, 'auto_generate_tags': 1}, + \{'path': '~/synced-notebooks/privatewiki/', 'syntax': 'markdown', 'ext': '.md'}, + \{'path': '~/synced-notebooks/sharedwiki/', 'syntax': 'markdown', 'ext': '.md'}] +let g:vimwiki_map_prefix = 'm' +augroup filetype_vimwiki + autocmd! + " Wrap lines nicely + autocmd Filetype vimwiki set breakindent + autocmd Filetype vimwiki set breakindentopt=shift:2 +augroup END + +" Vim-Zettel configuration +let g:zettel_options = [{}, {"front_matter": [["tags", ""], ["type", "note"] ], "template": "~/work_notebook/templates/daily_note.tpl"}] + +" Table Mode configuration +let g:table_mode_map_prefix = 't' + +" --- Language Specific --- +" - All - +" let g:polyglot_disabled = ['python'] + +" COC +" let g:coc_node_path = '$HOME/.nvm/versions/node/v12.16.3/bin/node' + +set updatetime=300 +set shortmess+=c " don't give |ins-completion-menu| messages. + +" - Svelte - +let g:svelte_preprocessor_tags = [ +\ { 'name': "ts", 'tag': "script", 'as': "typescript" } +\ ] +let g:svelte_preprocessors = ["scss", "sass", "typescript", "ts"] +let g:vim_svelte_plugin_load_full_syntax = 1 +let g:vim_svelte_plugin_use_sass = 1 +let g:vim_svelte_plugin_use_typescript = 1 +let g:vim_svelte_plugin_use_foldexpr = 0 + +if !exists('g:context_filetype#same_filetypes') + let g:context_filetype#filetypes = {} +endif + +let g:context_filetype#filetypes.svelte = +\ [ +\ {'filetype' : 'typescript', 'start': ']*\)\? \%(ts\|lang="\%(ts\|typescript\)"\)\%( [^>]*\)\?>', 'end': ''}, +\ {'filetype' : 'javascript', 'start' : ''}, +\ {'filetype' : 'scss', 'start' : ''}, +\ {'filetype' : 'sass', 'start' : ''}, +\ {'filetype' : 'css', 'start' : ''}, +\ ] + +let g:ft = '' + +" For NERDCommenter +let g:NERDSpaceDelims = 1 +" let g:NERDCompactSexyComs = 1 + +fu! NERDCommenter_before() + if (&ft == 'html') || (&ft == 'svelte') + let g:ft = &ft + let cfts = context_filetype#get_filetypes() + if len(cfts) > 0 + if cfts[0] == 'svelte' + let cft = 'html' + else + let cft = cfts[0] + endif + echo "Using filetype=".cft." for comment" + exe 'setf '.cft + if exists('b:NERDCommenterDelims') + unlet b:NERDCommenterDelims + endif + call nerdcommenter#SetUp() + endif + endif +endfu + +fu! NERDCommenter_after() + if g:ft == 'svelte' + exec 'setf '.g:ft + if exists('b:NERDCommenterDelims') + unlet b:NERDCommenterDelims + endif + call nerdcommenter#SetUp() + let g:ft = '' + endif +endfu + +" Prettier +let g:prettier#quickfix_enabled = 0 +let g:prettier#autoformat_require_pragma = 0 +au BufWritePre *.css,*.svelte,*.pcss,*.html,*.ts,*.js,*.json PrettierAsync + +" - Web - +let g:user_emmet_install_global=0 +augroup Emmet + autocmd! + autocmd Filetype html,css if exists('g:loaded_emmet_vim') | + \ EmmetInstall | + \ endif +augroup END +" let g:user_emmet_leader_key='' + +" - Javascript - +" Javascript configuration +let g:javascript_enable_dom_htmlcss = 1 + +" - Python - +" Run in python using F9 +augroup Python + autocmd! + autocmd FileType python nnoremap :exec '!python' shellescape(@%, 1) +augroup END + +" Documentation +let g:pymode_doc = 1 +let g:pymode_doc_key = 'K' + +" Linting +let g:pymode_lint = 1 +let g:pymode_lint_checkers = ['pyflakes', 'pep8'] +let g:pymode_lint_message = 1 + +" Auto check on save +let g:pymode_lint_write = 1 + +" Support virtualenv +let g:pymode_virtualenv = 1 + +" Enable breakpoints plugin +let g:pymode_breakpoint = 1 +let g:pymode_breakpoint_bind = 'b' + +" Syntax highlighting +let g:pymode_syntax = 1 +let g:pymode_syntax_all = 1 +let g:pymode_syntax_indent_errors = g:pymode_syntax_all +let g:pymode_syntax_space_errors = g:pymode_syntax_all + +" Enable python folding +let g:pymode_folding = 1 + +" Enable pymode motion +let g:pymode_motion = 1 + +" Set up default python options +let g:pymode_options = 1 + +" Trim whitespace on save +let g:pymode_trim_whitespaces = 1 + +" PEP8-compatible python indent +" let g:pymode_indent = 1 + +" Rope support +let g:pymode_rope = 0 + +" [YELP] Ignore line too long +let g:pymode_lint_ignore = "W503,E128" + +" - Rust - +" Rust racer +let g:racer_cmd = "~/dotfiles/racer/target/release/racer" +" Must install Rust source to this location first +let $RUST_SRC_PATH="/usr/local/src/rust/src/" +" Rust folding +let g:rust_fold = 2 + +" - Processing - +let g:processing_fold = 1 + +" - Markdown - +let g:livedown_open = 1 +]]) diff --git a/config/nvim/config/plugin.vimrc b/config/nvim/config/plugin.vimrc index b0457ce..368d77a 100644 --- a/config/nvim/config/plugin.vimrc +++ b/config/nvim/config/plugin.vimrc @@ -73,6 +73,8 @@ let g:startify_custom_header = map(split(system('fortune -a -s | fmt -80 -s | co " Automatically open tagbar when entering supported buffer " autocmd BufEnter * nested :call tagbar#autoopen(0) +" - Generative AI - + " - Utility - " DelimitMate sane bracing let delimitMate_expand_cr = 1 diff --git a/config/nvim/init.vim b/config/nvim/init.lua similarity index 63% rename from config/nvim/init.vim rename to config/nvim/init.lua index e2385b4..8792814 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.lua @@ -1,17 +1,19 @@ -" Source config files -source $HOME/.config/nvim/config/plugin.vimrc +vim.cmd([[ +" -- Source config files source $HOME/.config/nvim/config/bindings-vimwiki.vimrc source $HOME/.config/nvim/config/init.vimrc +source $HOME/.config/nvim/config/plugin.vimrc source $HOME/.config/nvim/config/general.vimrc source $HOME/.config/nvim/config/bindings.vimrc source $HOME/.config/nvim/config/functions.vimrc -" Python dependencies -let g:python_host_prog=expand('$HOME/.pyenv/versions/neovim2/bin/python') -let g:python3_host_prog=expand('$HOME/.pyenv/versions/neovim3/bin/python') +" -- Python dependencies +let g:python_host_prog = expand("~/.pyenv/versions/neovim2/bin/python") +let g:python3_host_prog = expand("~/.pyenv/versions/neovim3/bin/python") -" Local overrides +" -- Local overrides let $LOCALFILE=expand("$HOME/.nvim_local.vimrc") if filereadable($LOCALFILE) source $LOCALFILE endif +]]) diff --git a/install.sh b/install.sh index 0c7f6f9..d777f1a 100755 --- a/install.sh +++ b/install.sh @@ -595,6 +595,7 @@ function main() { install_aur setup_system_configs setup_samba + setup_ssh install_local elif [[ $response == "push" ]]; then push_dotfiles diff --git a/packages/arch.local b/packages/arch.local new file mode 100644 index 0000000..ca34130 --- /dev/null +++ b/packages/arch.local @@ -0,0 +1,9 @@ +alacritty +tigervnc +picard +colord +colord-kde +easyeffects +sway +bitwarden +steam diff --git a/packages/aur.local b/packages/aur.local new file mode 100644 index 0000000..0ff60c3 --- /dev/null +++ b/packages/aur.local @@ -0,0 +1,7 @@ +element-desktop-nightly-bin +tutanota-desktop +jetbrains-toolbox +godot-mono +fprintd +libinput-gestures +picard diff --git a/packages/flatpak.local b/packages/flatpak.local new file mode 100644 index 0000000..86b78e8 --- /dev/null +++ b/packages/flatpak.local @@ -0,0 +1 @@ +flathub com.plexamp.Plexamp