@ -2,18 +2,86 @@
let
secrets = import ./secrets.nix ;
doom-emacs = pkgs . callPackage
( builtins . fetchTarball {
url = https://github.com/nix-community/nix-doom-emacs/archive/master.tar.gz ;
} )
{
doomPrivateDir = ./doom ;
} ;
in
{
home . packages = with pkgs ; [
ripgrep fd wget mosh w3m nnn urlview gnupg hexyl httpie catimg tealdeer du-dust duplicati bitwarden-cli rage sd eva glow restic tig gitui spotify-tui manix amfora weechat duf procs pandoc magic-wormhole pastel fx
nodejs deno yarn nodePackages . stylelint nodePackages . js-beautify
ocaml dune_2 ocamlPackages . utop ocamlPackages . ocp-indent ocamlPackages . merlin
ripgrep
fd
wget
mosh
w3m
urlview
gnupg
hexyl
httpie
timg
tealdeer
du-dust
duplicati
bitwarden-cli
rage
sd
eva
glow
restic
gitui
spotify-tui
manix
amfora
weechat
duf
procs
pandoc
magic-wormhole
pastel
jo # jo name=Dustin age=99 -> { name: "dustin", age: 99 }
fx # jo -a one two three | fx ".map(e => e.length > 3)" -> [false, false, true]
bandwhich
nodejs
deno
yarn
nodePackages . typescript-language-server
nodePackages . stylelint
nodePackages . js-beautify
ocaml
dune_2
ocamlPackages . utop
ocamlPackages . ocp-indent
ocamlPackages . merlin
# racket-minimal
rustc
ghc cargo haskell-language-server hlint haskellPackages . hoogle # haskellPackages.cabal
nixfmt shellcheck fontconfig cmigemo cacert
emacsPackages . fontawesome emacs-all-the-icons-fonts
ispell aspell aspellDicts . en aspellDicts . en-computers aspellDicts . en-science aspellDicts . fr aspellDicts . de aspellDicts . eo aspellDicts . es
ghc
cargo
go
haskell-language-server
hlint
haskellPackages . hoogle # haskellPackages.cabal
nixfmt
shellcheck
fontconfig
cmigemo
cacert
emacsPackages . fontawesome
emacs-all-the-icons-fonts
ispell
aspell
aspellDicts . en
aspellDicts . en-computers
aspellDicts . en-science
aspellDicts . fr
aspellDicts . de
aspellDicts . eo
aspellDicts . es
doom-emacs
code-minimap
] ;
home . sessionVariables = {
@ -35,18 +103,15 @@ in
secureSocket = false ;
plugins = with pkgs . tmuxPlugins ; [
sensible
continuum
resurrect # prefix ctrl-s -> save; prefix ctrl-r -> restore
pain-control # prefix |, -, \, _ to split; prefix h, j, k, l to switch; prefix H, J, K, L to resize; prefix <, > to move
fzf-tmux-url # prefix u -> fzf urls
yank # prefix y -> copy command line to clipboard; prefix Y -> copy pwd to clipboard; search + y -> copy to clipboard
open # highlight: o -> open; ctrl-o -> $EDITOR; S -> web search
# vim-tmux-navigator # ctrl-h, -j, -k, -l -> move between tmux and vim splits # TODO doesn't work with helix
copycat # prefix ctrl-/ -> regex search; ctrl-f -> file search; ctrl-u -> url search; etc.
] ;
# set -g set-titles on
# set -g set-titles-string "#H (#S)"
extraConfig = ''
set - g set-titles on
set - g set-titles-string " # H ( # S ) "
set - g mouse on
set - g status-right " "
set - g status-left " "
@ -61,7 +126,8 @@ in
enableAliases = true ;
} ;
programs . zoxide = { # z doc -> cd ~/Documents; zi -> interactive
programs . zoxide = {
# z doc -> cd ~/Documents; zi -> interactive
enable = true ;
enableZshIntegration = true ;
} ;
@ -79,6 +145,7 @@ in
h = " h i m a l a y a " ;
er = " r m - r f l o g s ; u n z i p - o " ;
srsync = " r s y n c - - r s y n c - p a t h = ' s u d o r s y n c ' " ;
vim = " ~ / . l o c a l / b i n / l v i m " ; # trying out LunarVim
} ;
} ;
@ -92,7 +159,8 @@ in
enableZshIntegration = true ;
} ;
programs . fzf = { # ctrl-t, ctrl-r, ssh **<tab>
programs . fzf = {
# ctrl-t, ctrl-r, ssh **<tab>
enable = true ;
enableZshIntegration = true ;
defaultCommand = " f d - - t y p e f i l e - - c o l o r = a l w a y s " ;
@ -101,7 +169,8 @@ in
fileWidgetOptions = [ " - - m i n - h e i g h t 3 0 - - p r e v i e w - w i n d o w n o b o r d e r - - p r e v i e w ' ( b a t - - s t y l e = n u m b e r s , c h a n g e s - - w r a p n e v e r - - c o l o r a l w a y s { } | | c a t { } | | t r e e - C { } ) 2 > / d e v / n u l l ' " ] ;
} ;
programs . navi = { # ctrl-G
programs . navi = {
# ctrl-G
enable = true ;
enableZshIntegration = true ;
} ;
@ -136,7 +205,8 @@ in
signByDefault = true ;
key = " A D 1 1 7 5 0 1 5 1 C 1 0 8 8 1 9 7 0 B D 9 4 3 A B 4 9 B D 6 B 2 B 3 A 6 3 7 7 " ;
} ;
aliases = { # https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
aliases = {
# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
lg = " l o g - - c o l o r - - g r a p h - - p r e t t y = f o r m a t : ' % C r e d % h % C r e s e t - % C ( y e l l o w ) % d % C r e s e t % s % C g r e e n ( % c r ) % C ( b o l d b l u e ) < % a n > % C r e s e t ' - - a b b r e v - c o m m i t " ;
} ;
delta = {
@ -147,11 +217,6 @@ in
} ;
} ;
programs . emacs = {
enable = true ;
package = ( ( pkgs . emacsPackagesNgGen pkgs . emacs ) . emacsWithPackages ( epkgs : [ epkgs . vterm ] ) ) ;
} ;
programs . helix = {
enable = true ;
settings = {
@ -171,164 +236,6 @@ in
vimdiffAlias = true ;
withNodeJs = true ;
withPython3 = true ;
coc = {
enable = true ;
settings = ''
{
" t s s e r v e r . f o r m a t O n T y p e " : true ,
" c o c . p r e f e r e n c e s . f o r m a t O n T y p e " : true
}
'' ;
} ;
plugins = with pkgs . vimPlugins ; [ # ale
vim-repeat vim-snippets vim-signify vim-orgmode vim-devicons vim-startify vim-highlightedyank
emmet-vim # <ctrl-y>,
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<space> (delete all)
vim-expand-region # + / - to select increasingly larger / smaller regions∑
vim-better-whitespace # :StripWhitespace
vim-peekaboo # see registers when doing " @ and ctrl-r
vim-abolish # Substitution: :Subvert/child{,ren}/adult{,s}/g Coercios: crs (coerce to snake-case), crm (mixed), crc (camel), cru (upper), cr- (dash), cr., cr<space>, crt (title-case)
vim-polyglot # includes sensible, dups vim-sleuth
argtextobj-vim # daa => delete an argument
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-fugitive # Git, Gdiff, Gblame, Gstatus, Gcommit
vim-speeddating # ctrl-a & ctrl-x on dates
jdaddy-vim # cij: change inner json. gqaj: pretty print json
vim-surround # cs[{ -> change surrounding [ to {, cst -> change surrounding tag, ysiw] -> surround inner word with ], etc.
vim-tmux-navigator # ctrl-l -> right in vim splits then tmux panes, etc.
vim-sneak # stp -> jump to next occurance of 'tp'. ; -> next. , -> go back, `` -> back home
fzf-vim
vim-table-mode # <space>tm, || for rule, <space>tt -> tableize csv
tabular # :Tabularize /, :Tabu (shortcut & guess the right thing)
vim-markdown # zr, zR, zm, zM, za, zA, zc, zC for folding
vim-gnupg
vim-floaterm # <leader>T
undotree # <leader>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 = " l e t g : c h a d t r e e _ s e t t i n g s = { ' x d g ' : v : t r u e } " ;
}
{
plugin = vim-easy-align ; # gaip= -> align inner paragraph on first =, gaip*= -> align aroud all =
config = ''
xmap ga <Plug> ( EasyAlign )
nmap ga <Plug> ( EasyAlign )
'' ;
}
{
plugin = vim-easymotion ; # <leader><leader> w, <leader><leader>fx -> find x
config = " l e t g : E a s y M o t i o n _ s m a r t c a s e = 1 " ;
}
{
plugin = nerdcommenter ; # toggle: <leader>c<space>, comment: <leader>cc
config = " l e t g : N E R D S p a c e D e l i m s = 1 " ;
}
{
plugin = vim-airline ;
config = ''
let g:airline #extensions#tabline#enabled = 1
let g:airline #extensions#ale#enabled = 1
let g:airline_powerline_fonts = 1
'' ;
}
vim-airline-themes
{
plugin = nord-vim ;
config = ''
colorscheme nord
let g:nord_italic = 1
let g:nord_underline = 1
'' ;
}
] ;
extraConfig = ''
set hidden
set number
set ignorecase
set smartcase
set magic
set mouse = a
let mapleader = " \< S p a c e > "
let maplocalleader = " \\ "
let g:org_indent = 1
nnoremap <silent> <leader> : WhichKey ' <Space> ' <CR>
nnoremap <silent> <leader> t : CHADopen <CR>
nnoremap <silent> <leader> T : FloatermNew <CR>
nnoremap <silent> <leader> u : UndotreeToggle <cr>
" l e t g : c o c _ s n i p p e t _ n e x t = ' < t a b > '
" l e t g : c o c _ s n i p p e t _ p r e v = ' < S - T a b > '
" C o C
" U s e t a b f o r t r i g g e r c o m p l e t i o n w i t h c h a r a c t e r s a h e a d a n d n a v i g a t e .
inoremap <silent> <expr> <TAB> pumvisible ( ) ? " \< C - n > " : <SID> check_back_space ( ) ? " \< T A B > " : coc #refresh()
inoremap <expr> <S-TAB> pumvisible ( ) ? " \< C - p > " : " \< C - h > "
" M a k e < C R > a u t o - s e l e c t t h e f i r s t c o m p l e t i o n i t e m a n d n o t i f y c o c . n v i m t o
" f o r m a t o n e n t e r , < c r > c o u l d b e r e m a p p e d b y o t h e r v i m p l u g i n
inoremap <silent> <expr> <CR> pumvisible ( ) ? coc #_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function ! s:check_back_space ( ) abort
let col = col ( ' . ' ) - 1
return ! col || getline ( ' . ' ) [ col - 1 ] = ~ # '\s'
endfunction
" G o T o c o d e n a v i g a t i o n .
nmap <silent> gd <Plug> ( coc-definition )
nmap <silent> gy <Plug> ( coc-type-definition )
nmap <silent> gi <Plug> ( coc-implementation )
nmap <silent> gr <Plug> ( coc-references )
" U s e K t o s h o w d o c u m e n t a t i o n i n p r e v i e w w i n d o w .
nnoremap <silent> K : call <SID> show_documentation ( ) <CR>
function ! s:show_documentation ( )
if ( index ( [ ' vim' , ' help' ] , & filetype ) >= 0 )
execute ' h ' . expand ( ' <cword> ' )
elseif ( coc #rpc#ready())
call CocActionAsync ( ' doHover' )
else
execute ' ! ' . & keywordprg . " " . expand ( ' <cword> ' )
endif
endfunction
" H i g h l i g h t t h e s y m b o l a n d i t s r e f e r e n c e s w h e n h o l d i n g t h e c u r s o r .
autocmd CursorHold * silent call CocActionAsync ( ' highlight' )
nnoremap <silent> <leader> / : noh <cr>
nnoremap <leader> v <c-w> v <c-w> l
nnoremap <leader> s <c-w> s <c-w> j
nnoremap <silent> <leader> a : Rg <CR>
nnoremap <silent> <leader> f : Files <CR>
nnoremap <silent> <leader> b : Buffers <CR>
nnoremap <silent> <leader> w : Windows <CR>
nnoremap <silent> <leader> C : Commands <CR>
nnoremap <silent> <leader> hf : History <CR>
nnoremap <silent> <leader> hc : History : <CR>
nnoremap <silent> <leader> hs : History / <CR>
nnoremap <silent> <leader> l : BLines <CR>
nnoremap <silent> <leader> <leader> l : Lines <CR>
" n n o r e m a p < s i l e n t > < l e a d e r > t : B T a g s < C R >
nnoremap <silent> <leader> <leader> t : Tags <CR>
nnoremap <silent> <leader> gc : BCommits <CR>
nnoremap <silent> <leader> <leader> gc : Commits <CR>
nmap <leader> <tab> <plug> ( fzf-maps-n )
xmap <leader> <tab> <plug> ( fzf-maps-x )
omap <leader> <tab> <plug> ( fzf-maps-o )
imap <c-x> <c-k> <plug> ( fzf-complete-word )
imap <c-x> <c-f> <plug> ( fzf-complete-path )
imap <c-x> <c-j> <plug> ( fzf-complete-file-ag )
imap <c-x> <c-l> <plug> ( fzf-complete-line )
'' ;
} ;
programs . bat = {