diff --git a/home-cli.nix b/home-cli.nix index c3034a8..eb41db5 100644 --- a/home-cli.nix +++ b/home-cli.nix @@ -4,8 +4,8 @@ let secrets = import ./secrets.nix; in { - home.packages = with pkgs; [ # deno - ripgrep fd wget nodejs yarn cargo mosh w3m nnn urlview gnupg hexyl httpie cacert catimg tealdeer du-dust duplicati bitwarden-cli rage sd bottom magic-wormhole eva glow restic tig gitui pastel spotify-tui manix weechat amfora ghc ocaml + home.packages = with pkgs; [ # pastel magic-wormhole + ripgrep fd wget nodejs yarn cargo mosh w3m nnn urlview gnupg hexyl httpie cacert catimg tealdeer du-dust duplicati bitwarden-cli rage sd eva glow restic tig gitui spotify-tui manix amfora ghc ocaml weechat deno duf procs ispell aspell aspellDicts.en aspellDicts.en-computers aspellDicts.en-science aspellDicts.fr aspellDicts.de aspellDicts.eo aspellDicts.es ]; @@ -59,6 +59,11 @@ in enableZshIntegration = true; }; + # programs.atuin = { + # enable = true; + # enableZshIntegration = true; + # }; + programs.zsh = { enable = true; enableAutosuggestions = true; @@ -145,8 +150,17 @@ in vimdiffAlias = true; withNodeJs = true; withPython3 = true; - plugins = with pkgs.vimPlugins; [ - vim-repeat ale vim-snippets vim-signify vim-orgmode vim-devicons vim-startify vim-highlightedyank + coc = { + enable = true; + settings = '' + { + "tsserver.formatOnType": true, + "coc.preferences.formatOnType": true + } + ''; + }; + plugins = with pkgs.vimPlugins; [ # ale + vim-repeat vim-snippets vim-signify vim-orgmode vim-devicons vim-startify vim-highlightedyank emmet-vim # , vim-signature # marks in the gutter; mx (add), dmx (delete), m, (place next available), m. (next available if empty), m- (delete all on line), m (delete all) vim-expand-region # + / - to select increasingly larger / smaller regionsāˆ‘ @@ -158,7 +172,7 @@ in splitjoin-vim # gS / gJ to turn single-line code into multi, etc. MatchTagAlways # highlights the matching & surrounding tags vim-visual-multi # ctrl-n on word, n/N to select next/prev, [/] to switch cursors, q to skip, Q to remove current - vim-endwise # automatically add end block keyword or symbol + # vim-endwise # automatically add end block keyword or symbol vim-fugitive # Git, Gdiff, Gblame, Gstatus, Gcommit vim-speeddating # ctrl-a & ctrl-x on dates jdaddy-vim # cij: change inner json. gqaj: pretty print json @@ -170,7 +184,14 @@ in tabular # :Tabularize /, :Tabu (shortcut & guess the right thing) vim-markdown # zr, zR, zm, zM, za, zA, zc, zC for folding vim-gnupg + vim-floaterm # T + undotree # u + vim-which-key coc-nvim coc-css coc-html coc-eslint coc-tsserver coc-json coc-fzf coc-snippets + { + plugin = chadtree; # nvim-tree-lua + config = "let g:chadtree_settings = { 'xdg': v:true }"; + } { plugin = vim-easy-align; # gaip= -> align inner paragraph on first =, gaip*= -> align aroud all = config = '' @@ -186,14 +207,6 @@ in plugin = nerdcommenter; # toggle: c, comment: cc config = "let g:NERDSpaceDelims = 1"; } - { - plugin = vim-floaterm; - config = "nnoremap T :FloatermNew"; - } - { - plugin = vim-which-key; - config = "nnoremap :WhichKey ''"; - } { plugin = vim-airline; config = '' @@ -211,10 +224,6 @@ in let g:nord_underline = 1 ''; } - { - plugin = undotree; - config = "nnoremap u :UndotreeToggle"; - } ]; extraConfig = '' " set expandtab " insert spaces when tab is pressed @@ -232,11 +241,52 @@ in let mapleader="\" let maplocalleader="\\" - let g:coc_snippet_next = '' - let g:coc_snippet_prev = '' - let g:org_indent = 1 + nnoremap :WhichKey '' + nnoremap t :CHADopen + nnoremap T :FloatermNew + nnoremap u :UndotreeToggle + + " let g:coc_snippet_next = '' + " let g:coc_snippet_prev = '' + + " CoC + " Use tab for trigger completion with characters ahead and navigate. + inoremap pumvisible() ? "\" : check_back_space() ? "\" : coc#refresh() + inoremap pumvisible() ? "\" : "\" + + " Make auto-select the first completion item and notify coc.nvim to + " format on enter, could be remapped by other vim plugin + inoremap pumvisible() ? coc#_select_confirm() : "\u\\=coc#on_enter()\" + + function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction + + " GoTo code navigation. + nmap gd (coc-definition) + nmap gy (coc-type-definition) + nmap gi (coc-implementation) + nmap gr (coc-references) + + " Use K to show documentation in preview window. + nnoremap K :call show_documentation() + + function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif + endfunction + + " Highlight the symbol and its references when holding the cursor. + autocmd CursorHold * silent call CocActionAsync('highlight') + nnoremap / :noh nnoremap v vl nnoremap s sj @@ -276,6 +326,7 @@ in programs.mpv.enable = true; programs.jq.enable = true; programs.noti.enable = true; + programs.bottom.enable = true; programs.keychain = { enable = true; @@ -287,11 +338,18 @@ in programs.newsboat = { enable = true; + # extraConfig = '' + # urls-source "ttrss" + # ttrss-url "https://tt-rss.dustinswan.com/" + # ttrss-login "dustinswan" + # ttrss-passwordeval "gpg -dq ~/.dustinswan@tt-rss.dustinswan.com.gpg" + # ''; extraConfig = '' - urls-source "ttrss" - ttrss-url "https://tt-rss.dustinswan.com/" - ttrss-login "dustinswan" - ttrss-passwordeval "gpg -dq ~/.dustinswan@tt-rss.dustinswan.com.gpg" + urls-source "inoreader" + inoreader-app-id "999997602" + inoreader-app-key "INSERT_KEY_HERE" + inoreader-login "dustin@dustinswan.com" + inoreader-passwordeval "gpg --decrypt ~/.inoreader-password.gpg" ''; }; }