47 Commits

Author SHA1 Message Date
f9510ce4c4 nvim - add table macro 2025-08-06 11:14:46 -05:00
8c50aa8c60 nvim - fix lsp mappings 2025-08-06 11:10:18 -05:00
e596dbe71b nvim - fix broken LSP behavior
also add reference hover/styling support
2025-05-21 14:06:33 -05:00
ed89606f4e nvim - support functions as keymap bindings in utils module 2025-05-21 14:05:48 -05:00
240abfc7f6 nvim - move from aniseed to nfnl 2025-05-14 16:00:47 -05:00
d08ce2685e nvim - update mason-lspconfig usage 2025-05-13 10:33:23 -05:00
0903f1234f nvim - more migration to pure fennel away from aniseed 2025-05-02 16:14:38 -05:00
dcdca7d9e9 nvim - Add .nfnl.fnl file to root of nvim directory 2025-05-01 14:40:12 -05:00
f2c0cd2992 nvim - more refactor away from aniseed to pure fennel 2025-05-01 14:39:06 -05:00
5174167c99 nvim - further migration to pure fennel from aniseed 2025-04-30 09:59:35 -05:00
07eb5d3b94 nvim - replace aniseed.util fn-bridge with vim.api call 2025-04-29 10:08:21 -05:00
8186744af8 nvim - start of moving modules to pure fennel 2025-04-29 09:49:04 -05:00
acdba51080 nvim - add keybinding to clear terminal scrollback 2025-04-22 14:25:37 -05:00
9a79203170 nvim - fix diagnostic sign deprecation warning 2025-04-22 14:25:09 -05:00
24116f8264 nvim - update plugins; outdated with new versions/replacements 2025-04-22 11:17:23 -05:00
d3ebe7aef0 nvim - toggleterm: auto change term directory to "pwd" 2025-04-22 11:16:24 -05:00
c5c7d851dd nvim - show nbsp chars using visual marker 2025-04-22 11:15:51 -05:00
4d3dc61c77 nvim - orgmode ts grammer doesn't need to be setup 2025-04-22 11:15:00 -05:00
bdb1fbdfd5 nvim - fix zoom-toggle plugin bindings 2025-04-22 11:14:30 -05:00
e72ece36b1 update tmux history limit 2025-04-22 11:14:02 -05:00
7d4c4ae332 neovim: add toggleterm plugin 2023-12-04 11:34:06 -06:00
ae35f5455e neovim: update toggle conceal shortcut 2023-12-04 11:33:37 -06:00
7444d89fad NVIM: various plugin updates 2023-10-18 14:25:39 -05:00
69e1b233d1 NVIM: add mapping for orgmode to toggle checkbox 2023-10-18 14:24:55 -05:00
19930e36d5 NVIM: Update fugitive mappings for a force push 2023-10-18 14:23:54 -05:00
5e5f6ffe49 NVIM: add mapping for extended date format insert 2023-10-18 14:23:15 -05:00
e89869917a NVIM: update telescope plugin settings 2023-10-18 14:22:35 -05:00
80a417fec8 update bash dotfiles 2023-10-18 14:21:52 -05:00
42dc9244be add curltime alias 2023-06-30 10:20:21 -05:00
f30097325b support broot command 2023-06-30 10:20:05 -05:00
88200beefa ignore generated lua files for neovim 2023-06-30 10:19:25 -05:00
ea8112cf35 aliases - git root alias 2023-06-29 15:29:14 -05:00
cf9ef0b5e0 neovim - ensure solarized8 on clean install 2023-06-29 15:28:21 -05:00
1200d06efc neovim - paredit support in other languages 2023-06-29 15:26:27 -05:00
c20fef8542 neovim - no unicode diagnostic signs 2023-06-29 15:26:01 -05:00
4d0512b9aa fix git branch clean alias 2023-06-29 15:25:04 -05:00
c2d5402d28 back out unicode lsp diagnostic symbols 2023-06-16 14:00:27 -05:00
f4369a98ff neovim - add yanky.vim plugin for ring buffer 2023-04-24 20:11:58 -05:00
037ad7d879 neovim - fix plugin load race condition for mason and lspconfig 2023-04-18 20:41:48 -05:00
948c8b4345 neovim - rainbow csv and base64 plugins 2023-04-18 20:41:09 -05:00
9c7237c7e1 neovim - update zoom-toggle 2023-04-18 19:18:30 -05:00
ce6dca9733 neovim - lua lsp name fix 2023-04-18 19:17:55 -05:00
6c0639068d neovim - neovim 0.9.0 updates 2023-04-18 19:17:20 -05:00
df8d793467 neovim - utils namespace updates 2023-04-18 19:16:52 -05:00
0d22d7fa46 neovim - paredit smartjump enable 2023-04-18 19:15:30 -05:00
fa7904e131 neovim - project plugin and telescope updates 2023-04-18 19:14:25 -05:00
9a302cb6c2 neovim - smartsplits plugin 2023-04-18 19:13:50 -05:00
75 changed files with 1720 additions and 781 deletions

View File

@@ -1,3 +1,4 @@
shopt -s globstar
[[ -f ~/.bashrc ]] && . ~/.bashrc [[ -f ~/.bashrc ]] && . ~/.bashrc
@@ -5,6 +6,8 @@ PATH=/usr/local/sbin:/usr/local/bin:~/bin:/usr/local/share/npm/bin:$PATH
PATH=$PATH:$HOME PATH=$PATH:$HOME
MANPATH=$MANPATH:/usr/local/opt/erlang/lib/erlang/man MANPATH=$MANPATH:/usr/local/opt/erlang/lib/erlang/man
export XDG_CONFIG_HOME=$HOME/.config
set -o vi set -o vi
export EDITOR='nvim' export EDITOR='nvim'
@@ -110,4 +113,6 @@ export LESS_TERMCAP_us=$'\e'"[1;32m"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[ -s ".config/broot/launcher/bash/br" ] && source /Users/sproctor/.config/broot/launcher/bash/br [ -s "$HOME/.config/broot/launcher/bash/br" ] && source "$HOME/.config/broot/launcher/bash/br"
# source /Users/proctor/.config/broot/launcher/bash/br

View File

@@ -39,3 +39,5 @@ export XML_CATALOG_FILES=/usr/local/etc/xml/catalog
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. # Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin" export PATH="$PATH:$HOME/.rvm/bin"
# source ~/.config/broot/launcher/bash/br

0
.gitignore vendored Normal file
View File

View File

@@ -4,11 +4,14 @@ alias ll='ls -l'
alias la='ls -a' alias la='ls -a'
alias lhal='ls -hal' alias lhal='ls -hal'
#curl
alias curltime="curl -w \"@$HOME/utils/curl-time-format.txt\" -o /dev/null -s "
#git aliases #git aliases
alias ?='git status' alias ?='git status'
alias ga='git add' alias ga='git add'
alias gaa='git add .' alias gaa='git add .'
alias gbc="git branch -vv | grep -e '[origin/[^:]*: gone]' | awk '{print \$1}' | xargs git branch -D" alias gbc="git branch -vv | grep -e '[origin/[^:]*: gone]' | awk '{print \$1}' | xargs --no-run-if-empty git branch -D"
alias gbd='git branch -d' alias gbd='git branch -d'
alias gc='git commit' alias gc='git commit'
alias gcb='git branch --show-current' alias gcb='git branch --show-current'
@@ -19,6 +22,7 @@ alias gmerge='git merge --ff-only'
alias gpull='git pull --rebase' alias gpull='git pull --rebase'
alias gpush='git push' alias gpush='git push'
alias gpush!='git push -u origin `git rev-parse --abbrev-ref HEAD`' alias gpush!='git push -u origin `git rev-parse --abbrev-ref HEAD`'
alias gr='cd $(git rev-parse --show-toplevel)'
alias master!='git checkout master' alias master!='git checkout master'
alias main!='git checkout main' alias main!='git checkout main'
alias merged?='git branch --merged' alias merged?='git branch --merged'

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,14 @@
;; [nfnl-macro]
(fn tx [& args]
"Mixed sequential and associative tables at compile time. Because the Neovim ecosystem loves them but Fennel has no neat way to express them (which I think is fine, I don't like the idea of them in general)."
(let [to-merge (when (table? (. args (length args)))
(table.remove args))]
(if to-merge
(do
(each [key value (pairs to-merge)]
(tset args key value))
args)
args)))
{: tx}

View File

@@ -1,65 +1,58 @@
(module dotfiles.conceal (local u (require :dotfiles.util))
{autoload {nvim aniseed.nvim
nu aniseed.nvim.util
u dotfiles.util}})
(local conceals {:defn "𝑓"
;; :defn- :
:fn "λ"
:lambda "λ"
:and "∧"
:&& "∧"
:or ""
:|| ""
:not "¬"
:! "¬"
:for "∀"
:in "∈"
; "\\<not\\> \\<in\\>" :∉
:true ""
:false "⊥"
;; and
;; or
;; if-not
;; when-not
;; (not
;; None | ∅
;; true, false | , ⊥ (top and bottom from logic)
;;
;; for | ∀
;; in | ∈
;; not in | ∉
})
(def conceals {:defn :𝑓 (fn setup-conceals []
;; :defn- : (vim.fn.clearmatches)
:fn :λ
:lambda :λ
:and :∧
:&& :∧
:or :
:|| :
:not :¬
:! :¬
:for :∀
:in :∈
; "\\<not\\> \\<in\\>" :∉
:true :
:false :⊥
;; and
;; or
;; if-not
;; when-not
;; (not
;; None | ∅
;; true, false | , ⊥ (top and bottom from logic)
;;
;; for | ∀
;; in | ∈
;; not in | ∉
})
(defn setup-conceals []
(nvim.fn.clearmatches)
(each [the-match replacement (pairs conceals)] (each [the-match replacement (pairs conceals)]
(let [the-match (.. "\\<" the-match "\\>" )] (let [the-match (.. "\\<" the-match "\\>")]
(nvim.fn.matchadd :Conceal the-match 0 -1 {:conceal replacement}))) (vim.fn.matchadd :Conceal the-match 0 -1 {:conceal replacement})))
(set vim.wo.conceallevel 2)
(set vim.wo.concealcursor :nvc))
(set nvim.wo.conceallevel 2) (fn toggle-conceal []
(set nvim.wo.concealcursor :nvc)) (if (= 0 vim.wo.conceallevel)
(set vim.wo.conceallevel 2)
(set vim.wo.conceallevel 0)))
(defn toggle-conceal []
( if (= 0 nvim.wo.conceallevel)
(set nvim.wo.conceallevel 2)
(set nvim.wo.conceallevel 0)))
;(setup-conceals) ;(setup-conceals)
;(toggle-conceal) ;(toggle-conceal)
;(if true true false) ;(if true true false)
(vim.api.nvim_create_user_command :ToggleConceal toggle-conceal {})
(vim.api.nvim_create_user_command :SetupConceals setup-conceals {})
(u.nnoremap :<leader>ts "call ToggleConceal()")
(nu.fn-bridge :ToggleConceal :dotfiles.conceal :toggle-conceal {:return false}) (local pretty-filetypes [:fennel :clojure])
(nu.fn-bridge :SetupConceals :dotfiles.conceal :setup-conceals {:return false})
(u.nnoremap :<leader>tc "call ToggleConceal()")
(def pretty-filetypes [:fennel
:clojure])
(each [_ ftype (pairs pretty-filetypes)] (each [_ ftype (pairs pretty-filetypes)]
(nvim.ex.autocmd :FileType ftype :call "SetupConceals()")) (vim.api.nvim_create_autocmd [:FileType]
{:pattern ftype :callback setup-conceals}))
{: setup-conceals}

View File

@@ -1,97 +1,94 @@
(module dotfiles.core {autoload {a aniseed.core} (local a (require :nfnl.core))
require {anenv aniseed.env (local u (require :dotfiles.util))
nvim aniseed.nvim
nu aniseed.nvim.util
u dotfiles.util}})
(nvim.ex.set :shortmess+=c) (vim.cmd.set :shortmess+=c)
; don't give |ins-completion-menu| messages. ; don't give |ins-completion-menu| messages.
(nvim.ex.set :path+=**) (vim.cmd.set :path+=**)
(nvim.ex.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*") (vim.cmd.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*")
(defn- safe-source [filename] (fn safe-source [filename]
(let [glob (nvim.fn.glob filename)] (let [glob (vim.fn.glob filename)]
(if (not (a.empty? glob)) (if (not (a.empty? glob))
(nvim.ex.source filename)))) (vim.fn.source filename))))
; (a.map safe-source ["~/.vimrc" "~/.vimrc.local"]) ; (a.map safe-source ["~/.vimrc" "~/.vimrc.local"])
(def- backup-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup)) (local backup-dir (.. (vim.fn.glob :$HOME) :/.vim/backup))
(def- undo-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup)) (local undo-dir (.. (vim.fn.glob :$HOME) :/.vim/backup))
(def- on-opts [:autoindent (local on-opts [:autoindent
:autoread :autoread
:expandtab :expandtab
:exrc :exrc
; allow project level (neo)vim files ; allow project level (neo)vim files
:hlsearch :hlsearch
:ignorecase :ignorecase
:incsearch :incsearch
:number :number
:ruler :ruler
:secure :secure
:shiftround :shiftround
; When at 3 spaces and I hit >>, go to 4, not 5. ; When at 3 spaces and I hit >>, go to 4, not 5.
:showcmd :showcmd
; shows (parital) command in the status line ; shows (parital) command in the status line
:showmatch :showmatch
:smartcase :smartcase
:splitbelow :splitbelow
:splitright :splitright
:termguicolors :termguicolors
:title :title
:undofile :undofile
:wildmenu]) :wildmenu])
(def- val-based-opts {; :t_Co 256 (local val-based-opts {; :t_Co 256
:laststatus 2 :laststatus 2
:encoding :utf-8 :encoding :utf-8
:history 500 :history 500
:redrawtime 5000 :redrawtime 5000
:scrolloff 3 :scrolloff 3
:guifont :Hasklig :guifont :Hasklig
:guifontwide :Hasklig :guifontwide :Hasklig
:background :dark :background :dark
:backupdir backup-dir :backupdir backup-dir
:directory backup-dir :directory backup-dir
;Don't clutter my dirs up with swp and tmp files ;Don't clutter my dirs up with swp and tmp files
:grepprg "ag --vimgrep" :grepprg "ag --vimgrep"
; Use Silver Searcher instead of grep ; Use Silver Searcher instead of grep
:tags :tags :tags :tags
:updatetime 300 :updatetime 300
; per coc.vim for diagnostic messages ; per coc.vim for diagnostic messages
:signcolumn "auto:1-3" :signcolumn "auto:1-3"
:colorcolumn [81 100] :colorcolumn [81 100]
:cmdheight 2 :cmdheight 2
; Better display for messages ; Better display for messages
:undodir undo-dir :undodir undo-dir
:undolevels 1000 :undolevels 1000
:undoreload 10000 :undoreload 10000
:foldmethod :expr :foldmethod :expr
:foldexpr "nvim_treesitter#foldexpr()" :foldexpr "nvim_treesitter#foldexpr()"
:foldlevelstart 100 :foldlevelstart 100
:foldlevel 99 :foldlevel 99
:tabstop 2 :tabstop 2
:shiftwidth 2 :shiftwidth 2
:softtabstop 2 :softtabstop 2
:mouse "" :mouse ""
:list true :list true
:listchars "tab:➥\\ ,trail:·," :listchars "tab:➥\\ ,trail:·,nbsp:■"
:backspace "indent,eol,start" :backspace "indent,eol,start"
;allow backspacing over everything in insert mode ;allow backspacing over everything in insert mode
:wildmode "list:longest,list:full" :wildmode "list:longest,list:full"
:wrap false}) :wrap false})
(def- append-val-opts {:diffopt "algorithm:patience"}) (local append-val-opts {:diffopt "algorithm:patience"})
(defn- set-opt [[opt val]] (tset vim.opt (a.str opt) val)) (fn set-opt [[opt val]] (tset vim.opt (a.str opt) val))
(defn- set-opt+ [[opt val]] (fn set-opt+ [[opt val]]
(let [existing-opt-val (a.get nvim.o opt)] (let [existing-opt-val (a.get vim.o opt)]
(tset vim.opt (a.str opt) (a.str existing-opt-val "," val)))) (tset vim.opt (a.str opt) (a.str existing-opt-val "," val))))
(defn- set-opt-on [opt] (set-opt [opt true])) (fn set-opt-on [opt] (set-opt [opt true]))
(a.map set-opt-on on-opts) (a.map set-opt-on on-opts)
@@ -99,25 +96,24 @@
(a.map-indexed set-opt+ append-val-opts) (a.map-indexed set-opt+ append-val-opts)
(nvim.ex.syntax :on) (vim.cmd.syntax :on)
;; (nvim.ex.colorscheme :soluarized) ;; (nvim.ex.colorscheme :soluarized)
(nvim.ex.colorscheme :solarized8) (vim.cmd.colorscheme :solarized8)
;; (nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "soluarized") ;; (nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "soluarized")
(nvim.ex.autocmd :vimenter "*" :++nested :colorscheme :solarized8)
(vim.api.nvim_create_autocmd [:vimenter]
{:pattern "*"
:command "colorscheme solarized8"
:nested true})
;(nvim.ex.autocmd "vimenter" "*" "luafile" "treesitter.lua") ;(nvim.ex.autocmd "vimenter" "*" "luafile" "treesitter.lua")
; ;
; (nvim.fn.glob "~/.vimrc.local") ; (nvim.fn.glob "~/.vimrc.local")
(defn make-fennel-scratch [] (fn make-fennel-scratch []
(nvim.command "new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel")) (vim.cmd "new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel"))
(nu.fn-bridge :FennelScratchBuffer :dotfiles.core :make-fennel-scratch (vim.api.nvim_create_user_command :FennelScratchBuffer make-fennel-scratch {})
{:return false})
(u.nnoremap :<leader>fsb ":call FennelScratchBuffer ()<CR>") (u.nnoremap :<leader>fsb ":call FennelScratchBuffer ()<CR>")
(defn compile-fnl [] (print :recompiling)
(anenv.init {:force true :init :dotfiles.init}))
(nu.fn-bridge :AniseedCompile :dotfiles.core :compile-fnl {:return false})

View File

@@ -1,10 +1,17 @@
(module dotfiles.init (local a (require :nfnl.core))
{autoload (local str (require :nfnl.string))
{a aniseed.core} (local fs (require :nfnl.fs))
require
{nvim aniseed.nvim}})
(fn require-all []
(let [require-exclusions (a.->set [:init])]
(->> (fs.relglob :fnl/dotfiles :*.fnl)
(a.map #(a.first (str.split $ :.fnl)))
(a.filter #(not (a.contains? require-exclusions $)))
(a.map #(.. :dotfiles. $))
;(a.map #(require $))
)))
;; (require-all)
(require :dotfiles.core) (require :dotfiles.core)
(require :dotfiles.plugins) (require :dotfiles.plugins)
(require :dotfiles.mapping) (require :dotfiles.mapping)
@@ -12,5 +19,4 @@
(require :dotfiles.zoom-toggle) (require :dotfiles.zoom-toggle)
;(nvim.ex.source "~/.vimrc") ;(nvim.ex.source "~/.vimrc")
(a.println "(re)loaded") (a.println "(re)loaded")

View File

@@ -1,25 +1,19 @@
(module dotfiles.mapping (local util (require :dotfiles.util))
{autoload {nvim aniseed.nvim (local nfnl (require :nfnl.api))
nu aniseed.nvim.util
core aniseed.core
util dotfiles.util}})
(defn- noremap [mode from to] "Sets a mapping with {:noremap true}."
(nvim.set_keymap mode from to {:noremap true})) (fn noremap [mode from to]
"Sets a mapping with {:noremap true}."
(vim.keymap.set mode from to {:noremap true}))
; (set nvim.g.mapleader "\\") ; (set nvim.g.mapleader "\\")
(defn aniseed-reload [] (vim.keymap.set :n "<leader>`"
(each [k _ (ipairs package.loaded)] (fn []
(when (string.match k "^dotfiles%..+") (nfnl.compile-all-files (vim.fn.stdpath :config))
(tset package.loaded k nil))) (vim.cmd.source (.. (vim.fn.stdpath :config) :/init.lua))))
((. (require :aniseed.env) :init) {:module :dotfiles.init :compile true})
(core.println "aniseed reloaded!"))
(vim.keymap.set :n "<leader>`" aniseed-reload)
; (noremap :n "<leader>`" ":source ~/.config/nvim/init.lua<CR>") ; (noremap :n "<leader>`" ":source ~/.config/nvim/init.lua<CR>")
(noremap :n :<leader>! ":call AniseedCompile()<CR>")
(noremap :n :<Enter> ":nohlsearch<Enter>/<BS>") (noremap :n :<Enter> ":nohlsearch<Enter>/<BS>")
@@ -32,6 +26,8 @@
; Insert Date ; Insert Date
(noremap :n :<F5> "\"=strftime(\"%F\")<CR>p") (noremap :n :<F5> "\"=strftime(\"%F\")<CR>p")
(noremap :i :<F5> "<C-R>=strftime(\"%F\")<CR>") (noremap :i :<F5> "<C-R>=strftime(\"%F\")<CR>")
(noremap :n :<M-5> "\"=trim(system('date -u'))<CR>p")
(noremap :i :<M-5> "<C-R>=trim(system('date -u'))<CR>")
; Make markdown link with empty url ; Make markdown link with empty url
;map <Leader>ah S<a href="" target="_blank" rel="noopener noreferrer"><CR> ;map <Leader>ah S<a href="" target="_blank" rel="noopener noreferrer"><CR>
@@ -65,7 +61,10 @@
(noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app '%:p'<cr>") (noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app '%:p'<cr>")
; Run current statement in DadBod-UI ; Run current statement in DadBod-UI
(nvim.ex.autocmd :FileType :sql :nmap :<leader>s :vap<leader>S) ;; (nvim.ex.autocmd :FileType :sql :nmap :<leader>s :vap<leader>S)
(vim.api.nvim_create_autocmd [:FileType]
{:pattern :sql
:command "nmap <leader>s vap<leader>S"})
(noremap :n :Q ":.!bash <CR>") (noremap :n :Q ":.!bash <CR>")
@@ -79,28 +78,37 @@
; Trim trailing Whitespace in current line ; Trim trailing Whitespace in current line
(util.lnnoremap :tw "<C-U>.s/\\s\\+$//ge<CR>:nohlsearch<Enter>/<BS>") (util.lnnoremap :tw "<C-U>.s/\\s\\+$//ge<CR>:nohlsearch<Enter>/<BS>")
;; <Leader><C-l> in terminal to clear scrollback buffer
;; nmap <silent> <leader><C-l> :set scrollback=1 \| set scrollback=100000<cr>
(util.lnnoremap :<C-k> ":set scrollback=1 | :set scrollback 100000<cr>"
{:silent true})
;; tmap <silent> <leader><C-l> <C-\><C-n><leader><C-l>i
(util.ltnoremap :<C-k> "<C-\\><C-n><leader><C-l>i" {:silent true})
;; (noremap :n :<C-A-l> ":echo \"test\"\n")
; Window switching ; Window switching
; ˙ -> alt-h ; ˙ -> alt-h
; ∆ -> alt-j ; ∆ -> alt-j
; ˚ -> alt-k ; ˚ -> alt-k
; ¬ -> alt-l ; ¬ -> alt-l
;; Terminal mode ;; Terminal mode
(noremap :t "˙" "<c-\\><c-n><c-w>h") ;; (noremap :t "˙" "<c-\\><c-n><c-w>h")
(noremap :t "∆" "<c-\\><c-n><c-w>j") ;; (noremap :t "∆" "<c-\\><c-n><c-w>j")
(noremap :t "˚" "<c-\\><c-n><c-w>k") ;; (noremap :t "˚" "<c-\\><c-n><c-w>k")
(noremap :t "¬" "<c-\\><c-n><c-w>l") ;; (noremap :t "¬" "<c-\\><c-n><c-w>l")
;; Insert mode: ;; ;; Insert mode:
(noremap :i "˙" :<Esc><c-w>h) ;; (noremap :i "˙" :<Esc><c-w>h)
(noremap :i "∆" :<Esc><c-w>j) ;; (noremap :i "∆" :<Esc><c-w>j)
(noremap :i "˚" :<Esc><c-w>k) ;; (noremap :i "˚" :<Esc><c-w>k)
(noremap :i "¬" :<Esc><c-w>l) ;; (noremap :i "¬" :<Esc><c-w>l)
;; Visual mode: ;; ;; Visual mode:
(noremap :v "˙" :<Esc><c-w>h) ;; (noremap :v "˙" :<Esc><c-w>h)
(noremap :v "∆" :<Esc><c-w>j) ;; (noremap :v "∆" :<Esc><c-w>j)
(noremap :v "˚" :<Esc><c-w>k) ;; (noremap :v "˚" :<Esc><c-w>k)
(noremap :v "¬" :<Esc><c-w>l) ;; (noremap :v "¬" :<Esc><c-w>l)
;; Normal mode: ;; ;; Normal mode:
(noremap :n "˙" :<c-w>h) ;; (noremap :n "˙" :<c-w>h)
(noremap :n "∆" :<c-w>j) ;; (noremap :n "∆" :<c-w>j)
(noremap :n "˚" :<c-w>k) ;; (noremap :n "˚" :<c-w>k)
(noremap :n "¬" :<c-w>l) ;; (noremap :n "¬" :<c-w>l)

View File

@@ -1,17 +1,16 @@
(module dotfiles.plugin.cmp {autoload {nvim aniseed.nvim luasnip luasnip}}) (local cmp (require :cmp))
(local luasnip (require :luasnip))
(module config.plugin.cmp {autoload {nvim aniseed.nvim cmp cmp}}) (local cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp})
(def- cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp}) (local cmp-srcs [{:name :nvim_lsp}
{:name :nvim_lua}
(def- cmp-srcs [{:name :nvim_lsp} {:name :luasnip}
{:name :nvim_lua} {:name :vsnip}
{:name :luasnip} {:name :conjure}
{:name :vsnip} {:name :buffer}
{:name :conjure} {:name :orgmode}
{:name :buffer} {:name :emoji :max_item_count 8}])
{:name :orgmode}
{:name :emoji :max_item_count 8}])
;; Setup cmp with desired settings ;; Setup cmp with desired settings
(let [cmp (require :cmp)] (let [cmp (require :cmp)]

View File

@@ -1,13 +1,18 @@
(module dotfiles.plugin.colorizer (let [colorizer (require :colorizer)]
{autoload {colorizer colorizer}}) (colorizer.setup ["*"] {:RGB true
; #RGB hex codes, like #F00
(colorizer.setup [:*] :RRGGBB true
{:RGB true ; #RGB hex codes, like #F00 ; #RRGGBB hex codes, like #00FF00
:RRGGBB true ; #RRGGBB hex codes, like #00FF00 :names true
:names true ; "Name" codes like Blue ; "Name" codes like Blue
:RRGGBBAA true ; #RRGGBBAA hex codes :RRGGBBAA true
:rgb_fn true ; CSS rgb() and rgba() functions ; #RRGGBBAA hex codes
:hsl_fn true ; CSS hsl() and hsla() functions :rgb_fn true
:css true ; Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB ; CSS rgb() and rgba() functions
:css_fn true ; Enable all CSS *functions*: rgb_fn, hsl_fn :hsl_fn true
}) ; CSS hsl() and hsla() functions
:css true
; Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
:css_fn true
; Enable all CSS *functions*: rgb_fn, hsl_fn
}))

View File

@@ -1,36 +0,0 @@
(module dotfiles.plugin.compe
{autoload {nvim aniseed.nvim}})
(set nvim.o.completeopt "menuone,noselect")
(let [compe (require :compe)]
(when compe
(compe.setup
{:enabled true
:autocomplete true
:debug false
:min_length 1
:preselect "enable"
:throttle_time 80
:source_timeout 200
:incomplete_delay 400
:max_abbr_width 100
:max_kind_width 100
:max_menu_width 100
:documentation true
:source {:path true
:buffer true
:calc true
:emoji true
:nvim_lsp true
:nvim_lua true
:conjure true
:orgmode true
:vsnip true
:vim_dadbod_completion true}})))
(nvim.ex.inoremap "<silent><expr> <C-Space> compe#complete()")
(nvim.ex.inoremap "<silent><expr> <CR> compe#confirm('<CR>')")
(nvim.ex.inoremap "<silent><expr> <C-e> compe#close('<C-e>')")
(nvim.ex.inoremap "<silent><expr> <C-f> compe#scroll({ 'delta': +4 })")
(nvim.ex.inoremap "<silent><expr> <C-d> compe#scroll({ 'delta': -4 })")

View File

@@ -1,13 +1,13 @@
(module dotfiles.plugin.conjure (local core (require :nfnl.core))
{autoload {a aniseed.core (local conjure-config (require :conjure.config))
conjure-config conjure.config
nvim aniseed.nvim}})
; (set nvim.g.conjure#eval#result_register "*") ; (set nvim.g.conjure#eval#result_register "*")
; (set nvim.g.conjure#log#botright true) ; (set nvim.g.conjure#log#botright true)
(set nvim.g.conjure#mapping#doc_word "gk") (set vim.g.conjure#mapping#doc_word :gk)
(set nvim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC) (set vim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC)
(set nvim.g.conjure#extract#tree_sitter#enabled true) (set vim.g.conjure#extract#tree_sitter#enabled true)
(conjure-config.assoc-in [:filetypes] (a.concat (conjure-config.filetypes) [:markdown] )) (conjure-config.assoc-in [:filetypes]
(conjure-config.assoc-in [:filetype :markdown] "conjure.client.clojure.nrepl") (core.concat (conjure-config.filetypes) [:markdown]))
(conjure-config.assoc-in [:filetype :markdown] :conjure.client.clojure.nrepl)

View File

@@ -1,4 +0,0 @@
(module dotfiles.plugin.dadbodui
{autoload { nvim aniseed.nvim }})

View File

@@ -1,5 +1,2 @@
(module dotfiles.plugin.easyalign (let [util (require :dotfiles.util)]
{autoload {nvim aniseed.nvim (util.noremap :v :<leader><bslash> :EasyAlign*<Bar>))
util dotfiles.util }})
(util.noremap :v :<leader><bslash> "EasyAlign*<Bar>")

View File

@@ -1,9 +1,13 @@
(module dotfiles.plugin.fugitive (local util (require :dotfiles.util))
{autoload {nvim aniseed.nvim
nu aniseed.nvim.util
core aniseed.core
util dotfiles.util}})
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gp ":Git pull<CR>")
;; Determine load time of fugitive ;; Determine load time of fugitive
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gP ":Git push<CR>" ) ;; (vim.api.nvim_create_autocmd [:FileType] {:pattern ftype :callback setup-conceals})
(fn bufmap [mode from to] (util.noremap mode from to {:local? true}))
(fn map-fugitive-keys []
(bufmap :n :<leader>gp ":Git pull<CR>")
(bufmap :n :<leader>gP ":Git push<CR>")
(bufmap :n :<leader>gF ":Git push -f<CR>"))
(vim.api.nvim_create_autocmd [:FileType]
{:pattern :fugitive :callback map-fugitive-keys})

View File

@@ -1,2 +1 @@
(module dotfiles.plugin.headlines (local headlines (require :headlines))
{autoload {headlines headlines}})

View File

@@ -0,0 +1,3 @@
(let [hex (require :hex)]
(when hex
(hex.setup)))

View File

@@ -1,154 +1,192 @@
(module dotfiles.plugin.lspconfig (local a (require :nfnl.core))
{autoload {a aniseed.core (local u (require :dotfiles.util))
u dotfiles.util (local lsp (require :vim.lsp))
nvim aniseed.nvim (local lspconfig (require :lspconfig))
lsp vim.lsp (local cmp_nvim_lsp (require :cmp_nvim_lsp))
lspconfig lspconfig
nu aniseed.nvim.util
cmp_nvim_lsp cmp_nvim_lsp}})
(defn bufmap [mode from to] (u.noremap mode from to {:local? true})) (fn bufmap [mode from to opts]
(u.noremap mode from to (a.merge {:local? true} opts)))
(defn nbufmap [from to] (bufmap :n from to)) (fn nbufmap [from to opts] (bufmap :n from to opts))
(defn xbufmap [from to] (bufmap :x from to)) (fn xbufmap [from to opts] (bufmap :x from to opts))
(defn define-sign [level sign] (fn lsp-execute-command [client cmd ...]
(let [sign-level (.. :DiagnosticSign level)] (let [buf-uri (vim.uri_from_bufnr 0)
(nvim.fn.sign_define sign-level cursor (vim.api.nvim_win_get_cursor 0)
{:texthl sign-level :text sign :numhl sign-level}))) r (- (a.first cursor) 1)
c (a.second cursor)
opts [buf-uri r c]
args (a.concat opts [...])]
;;(client.exec_cmd {:command cmd :arguments args} {:bufnr 0})
(client.request_sync :workspace/executeCommand
{:command cmd :arguments args} nil 0)))
(define-sign :Error "☢️") (vim.diagnostic.config {:signs {:text {vim.diagnostic.severity.ERROR "☢️"
(define-sign :Warn "⚠️") vim.diagnostic.severity.WARN "⚠️"
(define-sign :SignHint "🔎") vim.diagnostic.severity.INFO ""
(define-sign :Info "") vim.diagnostic.severity.HINT "🔎"}
; (define-sign :Error :X) ;; :linehl {vim.diagnostic.severity.ERROR :ErrorMsg}
; (define-sign :Warn "!") ;; :numhl {vim.diagnostic.severity.WARN :WarningMsg}
; (define-sign :SignHint "?") }})
; (define-sign :Info :i)
(def core-nmappings (local core-nmappings
{:gd "lua vim.lsp.buf.definition()" {:gd "lua vim.lsp.buf.definition()"
:gD "lua vim.lsp.buf.declaration()" :gD "lua vim.lsp.buf.declaration()"
:gi "lua vim.lsp.buf.implementation()" :gi "lua vim.lsp.buf.implementation()"
:gr "lua vim.lsp.buf.references()" :gr "lua vim.lsp.buf.references()"
:K "lua vim.lsp.buf.hover()" :K "lua vim.lsp.buf.hover()"
"[g" "lua vim.diagnostic.goto_prev()" "[g" "lua vim.diagnostic.goto_prev()"
"]g" "lua vim.diagnostic.goto_next()" "]g" "lua vim.diagnostic.goto_next()"
;:<c-k> "lua vim.lsp.buf.signature_help()" ;:<c-k> "lua vim.lsp.buf.signature_help()"
:<leader>ca "lua vim.lsp.buf.code_action()" :<leader>ca "lua vim.lsp.buf.code_action()"
:<leader>cl "lua vim.lsp.codelens.run()" :<leader>cl "lua vim.lsp.codelens.run()"
:<leader>ic "lua vim.lsp.buf.incoming_calls()" :<leader>ic "lua vim.lsp.buf.incoming_calls()"
;; TODO: think of new mapping; conficts with org mode ;; TODO: think of new mapping; conficts with org mode
;; :<leader>oc "lua vim.lsp.buf.outgoing_calls()" ;; :<leader>oc "lua vim.lsp.buf.outgoing_calls()"
:<leader>sld "lua vim.diagnostic.open_float(nil, {source = 'always'})" :<leader>sld "lua vim.diagnostic.open_float(nil, {source = 'always'})"
:<leader>rn "lua vim.lsp.buf.rename()" :<leader>rn "lua vim.lsp.buf.rename()"
:<leader>fa "lua vim.lsp.buf.format()"}) :<leader>fa "lua vim.lsp.buf.format()"})
(def client-nmappings (local client-nmappings {:clojure_lsp {;;:<leader>cn "call LspExecuteCommand('clean-ns')"
{:clojure_lsp {:<leader>cn "call LspExecuteCommand('clean-ns')" ;; :<leader>ref "call LspExecuteCommand('extract-function', input('Function name: '))"
:<leader>ref "call LspExecuteCommand('extract-function', input('Function name: '))" ;; :<leader>id "call LspExecuteCommand('inline-symbol')"
:<leader>id "call LspExecuteCommand('inline-symbol')" ;; :<leader>il "call LspExecuteCommand('introduce-let', input('Binding name: '))"
:<leader>il "call LspExecuteCommand('introduce-let', input('Binding name: '))" ;;:<leader>m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))"
:<leader>m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))"}}) }})
(def client-command-lnmappings ;;(vim.fn.input "foo: ")
{:clojure_lsp {:ai [:add-import-to-namespace
["input('Namespace name: ')"]]
:am [:add-missing-libspec []]
:as [:add-require-suggestion
["input('Namespace name: ')"
"input('Namespace as: ')"
"input('Namespace name: ')"]]
:cc [:cycle-coll []]
:cn [:clean-ns []]
:cp [:cycle-privacy []]
:ct [:create-test []]
:df [:drag-forward []]
:db [:drag-backward []]
:df [:drag-forward []]
:dk [:destructure-keys []]
:ed [:extract-to-def ["input('Definition name: ')"]]
:ef [:extract-function ["input('Function name: ')"]]
:el [:expand-let []]
:fe [:create-function []]
:il [:introduce-let ["input('Binding name: ')"]]
:is [:inline-symbol []]
:ma [:resolve-macro-as []]
:mf [:move-form ["input('File name: ')"]]
:ml [:move-to-let ["input('Binding name: ')"]]
:pf [:promote-fn ["input('Function name: ')"]]
:sc [:change-collection ["input('Collection type: ')"]]
:sm [:sort-map []]
:tf [:thread-first-all []]
:tF [:thread-first []]
:tl [:thread-last-all []]
:tL [:thread-last []]
:ua [:unwind-all []]
:uw [:unwind-thread []]}})
(def server-specific-opts {}) (local client-command-lnmappings
{:clojure_lsp {:ai [:add-import-to-namespace
[(lambda [] (vim.fn.input "Namespace name: "))]]
:am [:add-missing-libspec []]
:as [:add-require-suggestion
[(lambda [] (vim.fn.input "Namespace name: "))
(lambda [] (vim.fn.input "Namespace as: "))
(lambda [] (vim.fn.input "Namespace name: "))]]
:cc [:cycle-coll []]
:cn [:clean-ns []]
:cp [:cycle-privacy []]
:ct [:create-test []]
:df [:drag-forward []]
:db [:drag-backward []]
:df [:drag-forward []]
:dk [:destructure-keys []]
:ed [:extract-to-def
[(lambda [] (vim.fn.input "Definition name: "))]]
:ref [:extract-function
[(lambda [] (vim.fn.input "Function name: "))]]
:el [:expand-let []]
:fe [:create-function []]
:il [:introduce-let
[(lambda [] (vim.fn.input "Binding name: "))]]
:is [:inline-symbol []]
:ma [:resolve-macro-as []]
:mf [:move-form
[(lambda [] (vim.fn.input "File name: "))]]
:ml [:move-to-let
[(lambda [] (vim.fn.input "Binding name: "))]]
:pf [:promote-fn
[(lambda [] (vim.fn.input "Function name: "))]]
:sc [:change-collection
[(lambda [] (vim.fn.input ""))
"input('Collection type: ')"]]
:sm [:sort-map []]
:tf [:thread-first-all []]
:tF [:thread-first []]
:tl [:thread-last-all []]
:tL [:thread-last []]
:ua [:unwind-all []]
:uw [:unwind-thread []]}})
(defn bind-client-mappings [client] (local server-specific-opts {})
(let [client-name (a.get client :name)
mappings (a.get client-nmappings client-name)
command-lnmappings (a.get client-command-lnmappings client-name)]
(when mappings
(each [mapping cmd (pairs mappings)]
(nbufmap mapping cmd)))
(when command-lnmappings
(each [lnmapping command-mapping (pairs command-lnmappings)]
(let [lsp-cmd (a.first command-mapping)
opts-str (accumulate [s "" i opt (ipairs (a.second command-mapping))]
(.. s ", " opt))
mapping (.. :<leader> lnmapping)
cmd (.. "call LspExecuteCommand('" lsp-cmd "'" opts-str ")")]
(nbufmap mapping cmd))))))
(defn on_attach [client bufnr] (fn bind-client-mappings [client]
(each [mapping cmd (pairs core-nmappings)] (let [client-name (a.get client :name)
(nbufmap mapping cmd)) ; x mode mappings mappings (a.get client-nmappings client-name)
(xbufmap :<leader>fa "lua vim.lsp.buf.format()") command-lnmappings (a.get client-command-lnmappings client-name)]
; -- buf_set_keymap('n', 'gs', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>', opts) (when mappings
; -- buf_set_keymap('n', 'gS', '<Cmd>lua vim.lsp.buf.workspace_symbol()<CR>', opts) (each [mapping cmd (pairs mappings)]
; -- buf_set_keymap('n', 'gt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) (nbufmap mapping cmd {})))
; -- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) (when command-lnmappings
; -- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) (each [lnmapping command-mapping (pairs command-lnmappings)]
; -- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) (let [lsp-cmd (a.first command-mapping)
; -- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts) ;;lsp-cmd (.. client-name "." (a.first command-mapping))
; -- buf_set_keymap('n', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts) ;;opts (a.second command-mapping)
; -- buf_set_keymap('x', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts) mapping (.. :<leader> lnmapping)
(nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc") cmd (lambda []
(bind-client-mappings client) (let [opts (accumulate [s "" _i opt (ipairs (a.second command-mapping))]
(if client.server_capabilities.documentFormattingProvider (.. s
(nvim.ex.autocmd :BufWritePre :<buffer> ":lua vim.lsp.buf.format()")) (if (= :function (type opt))
; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" :<buffer> :lua "vim.lsp.codelens.refresh()") (opt)
; client autocmds opt)))]
; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf_request_sync(vim.api.nvim_get_current_buf(), 'workspace/executeCommand', {command = 'clean-ns', arguments = {vim.uri_from_bufnr(1), vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[2]}, title = 'Clean Namespace'})]] (lsp-execute-command client lsp-cmd opts)))]
(print "LSP Client Attached.")) (nbufmap mapping cmd {:desc (.. "LSP command `" lsp-cmd "`")}))))))
(def base-server-opts (fn on_attach [client bufnr]
(let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))] (each [mapping cmd (pairs core-nmappings)]
{: on_attach : capabilities :flags {:debounce_text_changes 150}})) (nbufmap mapping cmd {})) ; x mode mappings
(xbufmap :<leader>fa "lua vim.lsp.buf.format()" {:desc "Format buffer"}) ; -- buf_set_keymap('n', 'gs', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>', opts)
; -- buf_set_keymap('n', 'gS', '<Cmd>lua vim.lsp.buf.workspace_symbol()<CR>', opts)
; -- buf_set_keymap('n', 'gt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
; -- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
; -- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
; -- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
; -- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
; -- buf_set_keymap('n', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts)
; -- buf_set_keymap('x', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts)
(vim.api.nvim_set_option_value :omnifunc "v:lua.vim.lsp.omnifunc" {:buf 0})
(bind-client-mappings client)
(when client.server_capabilities.documentHighlightProvider
(each [hlgroup base-group (pairs {:LspReferenceRead :SpecialKey
:LspReferenceText :SpecialKey
:LspReferenceWrite :SpecialKey})]
(vim.api.nvim_set_hl 0 hlgroup
(a.merge (vim.api.nvim_get_hl_by_name base-group
true)
{:italic true
:foreground "#6c71c4"
:background :NONE})))
(let [group (vim.api.nvim_create_augroup :LspDocumentHighlight
{:clear true})]
(vim.api.nvim_create_autocmd [:CursorHold :CursorHoldI]
{: group
:pattern :<buffer>
:callback (lambda []
(vim.lsp.buf.document_highlight))})
(vim.api.nvim_create_autocmd [:CursorMoved]
{: group
:pattern :<buffer>
:callback (lambda []
(vim.lsp.buf.clear_references))})))
(if client.server_capabilities.documentFormattingProvider
(vim.api.nvim_create_autocmd [:BufWritePre]
{:pattern :<buffer>
:callback (lambda [] (vim.lsp.buf.format))}))
(print "LSP Client Attached."))
(defn default-server-handler [server-name] (local base-server-opts
(let [specific-opts (a.get server-specific-opts server-name {}) (let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))]
server (a.get lspconfig server-name) {: on_attach : capabilities :flags {:debounce_text_changes 150}}))
server-opts (a.merge base-server-opts server-opts)]
(server.setup server-opts)))
(defn lsp-execute-command [cmd ...] (fn default-server-handler [server-name]
(let [buf-uri (vim.uri_from_bufnr 0) (let [specific-opts (a.get server-specific-opts server-name {})
cursor (vim.api.nvim_win_get_cursor 0) server-opts (a.merge base-server-opts specific-opts)]
r (- (a.first cursor) 1) (vim.lsp.config server-name server-opts)))
c (a.second cursor)
opts [buf-uri r c]
args (a.concat opts [...])]
(vim.lsp.buf.execute_command {:command cmd :arguments args})))
(when-let [mason-lspconfig (require :mason-lspconfig)] (mason-lspconfig.setup) (fn setup-handlers [language_servers]
(mason-lspconfig.setup_handlers {1 default-server-handler})) (each [_ server-name (pairs language_servers)]
(default-server-handler server-name)))
(u.nnoremap :<leader>li :LspInfo) (u.nnoremap :<leader>li :LspInfo)
(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig
:lsp-execute-command {:return false}) (vim.api.nvim_create_user_command :LspExecuteCommand lsp-execute-command
{:nargs "+"})
; (let [mason-lspconfig (require :mason-lspconfig)]
; (when mason-lspconfig
; (mason-lspconfig.setup)
; (mason-lspconfig.setup_handlers [default-server-handler])))
{: on_attach : default-server-handler : setup-handlers}

View File

@@ -1,19 +1,17 @@
(module dotfiles.plugin.luasnip (let [luasnip (require :luasnip)
{autoload {nvim aniseed.nvim util dotfiles.util luasnip luasnip} select_choice (require :luasnip.extras.select_choice)]
require {select_choice luasnip.extras.select_choice}}) (when luasnip
(vim.keymap.set [:i :s] :<C-k>
(vim.keymap.set [:i :s] :<C-k> (fn []
(fn [] (if (luasnip.expand_or_jumpable)
(if (luasnip.expand_or_jumpable) (luasnip.expand_or_jump)))
(luasnip.expand_or_jump))) {:silent true}) {:silent true})
(vim.keymap.set [:i :s] :<C-j>
(vim.keymap.set [:i :s] :<C-j> (fn []
(fn [] (if (luasnip.jumpable -1)
(if (luasnip.jumpable -1) (luasnip.jump -1))) {:silent true})
(luasnip.jump -1))) {:silent true}) (vim.keymap.set :i :<C-l>
(fn []
(vim.keymap.set :i :<C-l> (fn [] (if (luasnip.choice_active)
(if (luasnip.choice_active) (luasnip.choice 1))))
(luasnip.choice 1)))) (vim.keymap.set :i :<C-u> select_choice)))
(vim.keymap.set :i :<C-u> select_choice)

View File

@@ -1,6 +1,16 @@
(module dotfiles.plugin.mason (local mason (require :mason))
{autoload {nvim aniseed.nvim mason mason mason-lspconf mason-lspconfig}}) (local mason-lspconf (require :mason-lspconfig))
(local lspconfig (require :dotfiles.plugin.lspconfig))
(mason.setup {:ui {:icons {:package_installed "✓"}}}) (fn setup []
(mason.setup {:ui {:icons {:package_installed "✓"}}})
(when mason-lspconf
(mason-lspconf.setup {:ensure_installed [:lua_ls] :automatic_enable true})
(lspconfig.setup-handlers (mason-lspconf.get_installed_servers))))
(mason-lspconf.setup {:ensure_installed [:sumneko_lua]}) (setup)
;; (mason.setup)
;;
;; (when-let [mason-lspconfig (require :mason-lspconfig)]
;; (mason-lspconfig.setup)
;; (mason-lspconfig.setup_handlers {1 default-server-handler}))

View File

@@ -0,0 +1,2 @@
(local nfnl (require :nfnl))
(nfnl.setup {:compile_on_write true})

View File

@@ -1,13 +1,8 @@
(module dotfiles.plugin.null-ls (let [null-ls (require :null-ls)
{autoload {nvim aniseed.nvim lspconfig (require :dotfiles.plugin.lspconfig)]
a aniseed.core (when null-ls
nu aniseed.nvim.util (local null-ls-server-options
null-ls null-ls {:sources [null-ls.builtins.formatting.stylua
lspconfig dotfiles.plugin.lspconfig}}) null-ls.builtins.formatting.fnlfmt]
:on_attach lspconfig.on_attach})
(def null-ls-server-options (null-ls.setup null-ls-server-options)))
{:sources [null-ls.builtins.formatting.stylua
null-ls.builtins.formatting.fnlfmt]
:on_attach lspconfig.on_attach})
(null-ls.setup null-ls-server-options)

View File

@@ -1,47 +1,45 @@
(module dotfiles.plugin.orgbullets (local core (require :nfnl.core))
{autoload {nvim aniseed.nvim a aniseed.core ts-utils dotfiles.ts-utils}}) (local conceal (require :dotfiles.conceal))
(local ts-utils (require :dotfiles.ts-utils))
(local stars ["◉" "⦾" "○" "✸" "✿" "✶" "•" "‣"])
(def stars ["◉" "⦾" "○" "✸" "✿" "✶" "•" "‣"]) (local stars-query "(headline (stars) @stars)")
(def stars-query "(headline (stars) @stars)") (fn star-index [heading-level]
(let [star-count (core.count stars)
idx (math.fmod heading-level star-count)]
(if (< 0 idx)
idx
star-count)))
(defn star-index [heading-level] (local extmark-namespace (vim.api.nvim_create_namespace :HeaderStars))
(let [star-count (a.count stars)
idx (math.fmod heading-level star-count)]
(if (< 0 idx)
idx
star-count)))
(defonce extmark-namespace (vim.api.nvim_create_namespace :HeaderStars)) (local star-captures (ts-utils.make-query :org stars-query))
(def star-captures (ts-utils.make-query :org stars-query)) (fn gen-star-extmarks []
(when (= :org vim.bo.filetype)
(let [bufnr (vim.api.nvim_get_current_buf)
star-count (core.count stars)]
(vim.api.nvim_buf_clear_namespace bufnr extmark-namespace 0 -1)
(each [id node metadata (star-captures bufnr)]
(let [[start-line start-col end-row end-col] [(node:range)]
heading-level (if (= start-line end-row)
(- end-col start-col))
star (core.get stars (star-index heading-level))
replacement (string.format (core.str "%" (+ 2 heading-level) :s)
star)]
(vim.api.nvim_buf_set_extmark bufnr extmark-namespace start-line
start-col
{:end_col end-col
:end_row end-row
:virt_text [[replacement []]]
:virt_text_pos :overlay
:hl_mode :combine}))))))
(defn gen-star-extmarks [] (let [group (vim.api.nvim_create_augroup :HeaderStars {:clear true})]
(when (= :org vim.bo.filetype) (vim.api.nvim_create_autocmd [:FileChangedShellPost
(let [bufnr (vim.api.nvim_get_current_buf) :Syntax
star-count (a.count stars)] :TextChanged
(vim.api.nvim_buf_clear_namespace bufnr extmark-namespace 0 -1) :InsertLeave
(each [id node metadata (star-captures bufnr)] :WinScrolled]
(let [[start-line start-col end-row end-col] [(node:range)] {: group :callback conceal.setup-conceals}))
heading-level (if (= start-line end-row)
(- end-col start-col))
star (a.get stars (star-index heading-level))
replacement (string.format (a.str "%" (+ 2 heading-level) :s)
star)]
(vim.api.nvim_buf_set_extmark bufnr extmark-namespace start-line
start-col
{:end_col end-col
:end_row end-row
:virt_text [[replacement []]]
:virt_text_pos :overlay
:hl_mode :combine}))))))
(let [group (nvim.create_augroup :HeaderStars {:clear true})]
(nvim.create_autocmd [:FileChangedShellPost
:Syntax
:TextChanged
:InsertLeave
:WinScrolled]
{: group
;; :pattern [:*.org]
:callback gen-star-extmarks}))

View File

@@ -1,8 +1,6 @@
(module dotfiles.plugin.orgmode {autoload {orgmode orgmode}}) (let [orgmode (require :orgmode)]
;;(orgmode.setup_ts_grammar)
(orgmode.setup_ts_grammar) (orgmode.setup {:org_agenda_files ["~/Dropbox/org/*" "~/my-orgs/**/*"]
:org_default_notes_file "~/Dropbox/org/refile.org"
(orgmode.setup {:org_agenda_files ["~/Dropbox/org/*" "~/my-orgs/**/*"] :mappings {:org {:org_toggle_checkbox :<C-.>}}})
:org_default_notes_file "~/Dropbox/org/refile.org"}) (require :dotfiles.plugin.orgbullets))
(require :dotfiles.plugin.orgbullets)

View File

@@ -1,8 +1,4 @@
(module dotfiles.plugin.packer (local u (require :dotfiles.util))
{autoload
{u dotfiles.util}
require
{nvim aniseed.nvim}})
(u.nnoremap :<leader>pi :PackerInstall) (u.nnoremap :<leader>pi :PackerInstall)
(u.nnoremap :<leader>pu :PackerUpdate) (u.nnoremap :<leader>pu :PackerUpdate)

View File

@@ -1,87 +1,77 @@
(module dotfiles.plugin.paredit (local a (require :nfnl.core))
{autoload {nvim aniseed.nvim (local treesitter (require :dotfiles.plugin.treesitter))
a aniseed.core (local ts-parsers (require :nvim-treesitter.parsers))
nu aniseed.nvim.util (local ts-utils (require :nvim-treesitter.ts_utils))
paredit paredit (local languagetree (require :vim.treesitter.languagetree))
ts-parsers nvim-treesitter.parsers
ts-utils nvim-treesitter.ts_utils
languagetree vim.treesitter.languagetree}})
(defn list-member? [xs x] (a.some #(= x $1) (a.vals xs))) (set vim.g.paredit_smartjump 1)
(defn bool->int [bool] (if bool 1 0)) (fn list-member? [xs x]
(a.some #(= x $1) (a.vals xs)))
(defn int->bool [x] (if (= 0 x) false true)) (fn bool->int [bool] (if bool 1 0))
(defn toggle-global! [x] (->> (a.get nvim.g x) (fn int->bool [x] (if (= 0 x) false true))
(int->bool)
(not)
(bool->int)
(tset nvim.g x)))
(defn language-at-cursor [] (let [parser (ts-parsers.get_parser) (fn toggle-global! [x]
current-node (ts-utils.get_node_at_cursor) (->> (a.get vim.g x)
range (if current-node [(current-node:range)]) (int->bool)
lang (if range (not)
(languagetree.language_for_range parser (bool->int)
range))] (tset vim.g x)))
(if lang
(lang:lang))))
(defn parser-language [] (let [parser (ts-parsers.get_parser)] (fn language-at-cursor []
(when parser (let [parser (ts-parsers.get_parser)
(parser:lang)))) current-node (ts-utils.get_node_at_cursor)
range (if current-node [(current-node:range)])
lang (if range
(languagetree.language_for_range parser range))]
(if lang
(lang:lang))))
(def- paredit-langs [:clojure (fn parser-language []
:fennel (let [parser (ts-parsers.get_parser)]
:hy (when parser
:janet (parser:lang))))
:julia
:lfe
:lisp
:racket
:scheme
:shen])
(def- paredit-host-langs [:org :markdown :asciidoc]) (local paredit-langs [:clojure
:fennel
:hy
:janet
:julia
:lfe
:lisp
:racket
:scheme
:shen])
(defn- host-lang-in? [langs] (list-member? langs (parser-language))) (local paredit-host-langs [:org :markdown :asciidoc])
(defn paredit-lang? [lang] (list-member? paredit-langs lang)) (fn host-lang-in? [langs] (list-member? langs (parser-language)))
(defn TreeSitterLangParedit [] (fn paredit-lang? [lang] (list-member? paredit-langs lang))
(when (host-lang-in? paredit-host-langs)
(when-let [cursor-lang (language-at-cursor)]
(->> cursor-lang
(paredit-lang?)
(bool->int)
(set nvim.g.paredit_mode))
(nvim.fn.PareditInitBuffer))))
; (nvim.del_augroup_by_name "BabeliteParedit") (fn TreeSitterLangParedit []
; (nvim.get_autocmds {:group "BabeliteParedit"}) (when (host-lang-in? paredit-host-langs)
(let [cursor-lang (language-at-cursor)]
(when cursor-lang
(->> cursor-lang
(paredit-lang?)
(bool->int)
(set vim.g.paredit_mode))
(vim.fn.PareditInitBuffer)))))
;;(let [group (nvim.create_augroup :BabeliteParedit {:clear true})] (vim.api.nvim_create_autocmd [:FileType]
;; (nvim.create_autocmd [:CursorHold :CursorMoved] {:pattern :ruby
;; {: group :callback (lambda []
;; ;:pattern ["*.org" "*.md"] (vim.fn.PareditInitBalancingAllBracketsBuffer))})
;; :callback TreeSitterLangParedit}))
;;
;; (defn paredit-toggle! [] (toggle-global :paredit_mode) (vim.api.nvim_create_autocmd [:FileType]
;; (nvim.fn.PareditInitBuffer) {:pattern :javascript
;; nvim.g.paredit_mode :callback (lambda []
;; ) (vim.fn.PareditInitBalancingAllBracketsBuffer))})
;;
;; \ (vim.api.nvim_create_autocmd [:FileType]
;; (int->bool 0) {:pattern :terraform
;; (defn test [x] (a.get nvim.g x)) :callback (lambda []
;; (vim.fn.PareditInitBalancingAllBracketsBuffer))})
;; (test :pareditmode)
;; (a.get nvim.g :paredit_mode)
;; (comment ;
;; nvim.g.paredit_mode
;; ;
;;
;; (paredit-toggle!)
;; )

View File

@@ -0,0 +1,19 @@
(let [smart-splits (require :smart-splits)]
(when smart-splits
(smart-splits.setup)
;; recommended mappings
;; resizing splits
;; these keymaps will also accept a range,
;; for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)`
(vim.keymap.set :n :<M-S-h> smart-splits.resize_left)
(vim.keymap.set :n :<M-S-j> smart-splits.resize_down)
(vim.keymap.set :n :<M-S-k> smart-splits.resize_up)
(vim.keymap.set :n :<M-S-l> smart-splits.resize_right) ; ; moving between splits
(vim.keymap.set :n :<M-h> smart-splits.move_cursor_left)
(vim.keymap.set :n :<M-j> smart-splits.move_cursor_down)
(vim.keymap.set :n :<M-k> smart-splits.move_cursor_up)
(vim.keymap.set :n :<M-l> smart-splits.move_cursor_right) ; ; swapping buffers between windows
(vim.keymap.set :n :<leader><leader>h smart-splits.swap_buf_left)
(vim.keymap.set :n :<leader><leader>j smart-splits.swap_buf_down)
(vim.keymap.set :n :<leader><leader>k smart-splits.swap_buf_up)
(vim.keymap.set :n :<leader><leader>l smart-splits.swap_buf_right)))

View File

@@ -1,36 +1,45 @@
(module dotfiles.plugin.telescope (local util (require :dotfiles.util))
{autoload {nvim aniseed.nvim util dotfiles.util telescope telescope}}) (local telescope (require :telescope))
(def vimgrep_arguments [:ag (local vimgrep_arguments [:ag
:--nocolor :--nocolor
:--noheading :--noheading
:--number :--number
:--column :--column
:--nobreak :--nobreak
:--smart-case :--smart-case
:--hidden :--hidden
; "--skip-vcs-ignores" ; "--skip-vcs-ignores"
; "-g" "!.git/" ; "-g" "!.git/"
:--follow]) :--ignore
:.git
:--follow])
(telescope.setup {:defaults {: vimgrep_arguments} (telescope.load_extension :projects)
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}}) (telescope.load_extension :yank_history)
(telescope.setup {;; :defaults {: vimgrep_arguments}
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}
:extensions {:projects {:projects {}}}})
(util.lnnoremap :fc "Telescope commands")
(util.lnnoremap :fC "Telescope command_history")
(util.lnnoremap :ff "Telescope git_files hidden=true") (util.lnnoremap :ff "Telescope git_files hidden=true")
(util.lnnoremap :f- "Telescope find_files") (util.lnnoremap :f- "Telescope find_files")
(util.lnnoremap :fg "Telescope live_grep") (util.lnnoremap :fg "Telescope live_grep")
(util.lnnoremap "*" "Telescope grep_string") (util.lnnoremap "*" "Telescope grep_string")
(util.lnnoremap :fb "Telescope buffers") (util.lnnoremap :fb "Telescope buffers")
(util.lnnoremap :fd "Telescope diagnostics")
(util.lnnoremap :fH "Telescope help_tags") (util.lnnoremap :fH "Telescope help_tags")
(util.lnnoremap :fh "Telescope oldfiles")
(util.lnnoremap :fp "Telescope projects")
(util.lnnoremap :fm "Telescope keymaps") (util.lnnoremap :fm "Telescope keymaps")
(util.lnnoremap :fM "Telescope marks") (util.lnnoremap :fM "Telescope marks")
(util.lnnoremap :fh "Telescope oldfiles")
(util.lnnoremap :ft "Telescope filetypes") (util.lnnoremap :ft "Telescope filetypes")
(util.lnnoremap :fc "Telescope commands")
(util.lnnoremap :fC "Telescope command_history")
(util.lnnoremap :fq "Telescope quickfix") (util.lnnoremap :fq "Telescope quickfix")
(util.lnnoremap :fl "Telescope loclist") (util.lnnoremap :fl "Telescope loclist")
(util.lnnoremap :fsi "Telescope lsp_implementations") (util.lnnoremap :fsi "Telescope lsp_implementations")
(util.lnnoremap :fsr "Telescope lsp_references") (util.lnnoremap :fsr "Telescope lsp_references")
(util.lnnoremap :fsS "Telescope lsp_document_symbols") (util.lnnoremap :fsS "Telescope lsp_document_symbols")
(util.lnnoremap :fss "Telescope lsp_workspace_symbols") (util.lnnoremap :fss "Telescope lsp_workspace_symbols")
(util.lnnoremap :fy "Telescope yank_history")

View File

@@ -0,0 +1,27 @@
(local toggleterm (require :toggleterm))
(toggleterm.setup {:open_mapping "<c-\\>"
:start_in_insert true
:insert_mappings true
;; whether or not the open mapping applies in insert mode
:terminal_mappings true
;; whether or not the open mapping applies in the opened terminals
:persist_size true
:persist_mode true
;; if set to true (default) the previous terminal mode will be remembered
:autochdir true})
(fn set-terminal-keymaps []
(vim.keymap.set :t :<esc> "<C-\\><C-n>")
(vim.keymap.set :t :jk "<C-\\><C-n>")
(vim.keymap.set :t :<C-h> "<Cmd>wincmd h<CR>")
(vim.keymap.set :t :<C-j> "<Cmd>wincmd j<CR>")
(vim.keymap.set :t :<C-k> "<Cmd>wincmd k<CR>")
(vim.keymap.set :t :<C-l> "<Cmd>wincmd l<CR>")
(vim.keymap.set :t :<C-w> "<C-\\><C-n><C-w>"))
(vim.api.nvim_create_user_command :SetTerminalKeymaps set-terminal-keymaps {})
(vim.api.nvim_create_autocmd [:TermOpen]
{:pattern "term://*"
:callback set-terminal-keymaps})

View File

@@ -1,29 +1,31 @@
(module dotfiles.plugin.treesitter (local treesitter-configs (require :nvim-treesitter.configs))
{autoload {treesitter nvim-treesitter
ts_utils nvim-treesitter.ts_utils
treesitter-configs nvim-treesitter.configs}})
(treesitter-configs.setup (treesitter-configs.setup {:highlight {:enable true
{:highlight {:enable true ;; :additional_vim_regex_highlighting false
;; :additional_vim_regex_highlighting false :additional_vim_regex_highlighting [:org]}
:additional_vim_regex_highlighting [:org] :ensure_installed :all
} ; [:org]
:rainbow {:enable true
:ensure_installed :all ; [:org] :extended_mode true
; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
:rainbow {:enable true :max_file_lines 10000
:extended_mode true ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean ; Do not enable for files with more than 1000 lines, int
:max_file_lines 10000 ; Do not enable for files with more than 1000 lines, int :colors ["#dc322f"
:colors [ ; red
:#dc322f ; red "#b58900"
:#b58900 ; yellow ; yellow
:#d33682 ; magenta "#d33682"
:#859900 ; green ; magenta
:#2aa198 ; cyan "#859900"
:#268bd2 ; blue ; green
:#6c71c4 ; violet / brmagenta "#2aa198"
] ; table of hex strings ; cyan
} "#268bd2"
}) ; blue
"#6c71c4"
; violet / brmagenta
]
; table of hex strings
}})
; lua print(require('nvim-treesitter.parsers').get_parser():language_for_range({ require('nvim-treesitter.ts_utils').get_node_at_cursor():range() }):lang()) ; lua print(require('nvim-treesitter.parsers').get_parser():language_for_range({ require('nvim-treesitter.ts_utils').get_node_at_cursor():range() }):lang())

View File

@@ -1,5 +1,3 @@
(module dotfiles.plugin.whichkey (let [which-key (require :which-key)]
{autoload {which-key which-key}}) (when which-key
(which-key.setup {})))
(which-key.setup {})

View File

@@ -0,0 +1,32 @@
(local yanky (require :yanky))
(yanky.setup {:ring {:history_length 100
:storage :shada
:sync_with_numbered_registers true
:cancel_event :update}
:system_clipboard {:sync_with_ring true}})
(vim.keymap.set :n :p "<Plug>(YankyPutAfter)")
(vim.keymap.set :n :P "<Plug>(YankyPutBefore)")
(vim.keymap.set :n :gp "<Plug>(YankyGPutAfter)")
(vim.keymap.set :n :gP "<Plug>(YankyGPutBefore)")
(vim.keymap.set :n :<c-n> "<Plug>(YankyCycleForward)")
(vim.keymap.set :n :<c-p> "<Plug>(YankyCycleBackward)")
(vim.keymap.set :n "]p" "<Plug>(YankyPutIndentAfterLinewise)")
(vim.keymap.set :n "[p" "<Plug>(YankyPutIndentBeforeLinewise)")
(vim.keymap.set :n "]P" "<Plug>(YankyPutIndentAfterLinewise)")
(vim.keymap.set :n "[P" "<Plug>(YankyPutIndentBeforeLinewise)")
(vim.keymap.set :n :>p "<Plug>(YankyPutIndentAfterShiftRight)")
(vim.keymap.set :n :<p "<Plug>(YankyPutIndentAfterShiftLeft)")
(vim.keymap.set :n :>P "<Plug>(YankyPutIndentBeforeShiftRight)")
(vim.keymap.set :n :<P "<Plug>(YankyPutIndentBeforeShiftLeft)")
(vim.keymap.set :n :=p "<Plug>(YankyPutAfterFilter)")
(vim.keymap.set :n :=P "<Plug>(YankyPutBeforeFilter)")
(vim.keymap.set :x :p "<Plug>(YankyPutAfter)")
(vim.keymap.set :x :P "<Plug>(YankyPutBefore)")
(vim.keymap.set :x :gp "<Plug>(YankyGPutAfter)")
(vim.keymap.set :x :gP "<Plug>(YankyGPutBefore)")

View File

@@ -1,93 +1,112 @@
(module dotfiles.plugins {autoload {nvim aniseed.nvim (local packer (require :packer))
a aniseed.core (local core (require :nfnl.core))
;; util dotfiles.util
packer packer}
;; require {minpac minpac}
})
(defn safe-require-plugin-config [name] (fn safe-require-plugin-config [name]
(let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))] (let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))]
(when (not ok?) (when (not ok?)
(print (.. "dotfiles error: " val-or-err))))) (print (.. "dotfiles error: " val-or-err)))))
(defn- use [pkgs] "Iterates through the arguments as pairs and calls packer's use function for (fn use [pkgs]
"Iterates through the arguments as pairs and calls packer's use function for
each of them. Works around Fennel not liking mixed associative and sequential each of them. Works around Fennel not liking mixed associative and sequential
tables as well." tables as well."
(packer.startup (fn [use] (packer.startup (fn [use]
(each [name opts (pairs pkgs)] (each [name opts (pairs pkgs)]
(-?> (. opts :mod) (safe-require-plugin-config)) (-?> (. opts :mod) (safe-require-plugin-config))
(use (a.assoc opts 1 name)))))) (use (core.assoc opts 1 name))))))
(def- packages {:Olical/aniseed {} (local packages {:Olical/nfnl {}
:Olical/conjure {:mod :conjure} :Olical/conjure {:mod :conjure}
:Olical/fennel.vim {} :Olical/fennel.vim {}
:airblade/vim-gitgutter {} :ahmedkhalf/project.nvim {}
:clojure-vim/vim-jack-in {} :airblade/vim-gitgutter {}
:dhruvasagar/vim-table-mode {} :akinsho/toggleterm.nvim {:mod :toggleterm}
:folke/lsp-colors.nvim {} :clojure-vim/vim-jack-in {}
:folke/which-key.nvim {:mod :whichkey} :christianrondeau/vim-base64 {}
:hashivim/vim-terraform {} :dhruvasagar/vim-table-mode {}
:hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer :folke/lsp-colors.nvim {}
:hrsh7th/cmp-emoji :folke/which-key.nvim {:mod :whichkey}
:hrsh7th/cmp-nvim-lsp :gbprod/yanky.nvim {:mod :yanky}
:hrsh7th/cmp-nvim-lua :hashivim/vim-terraform {}
:hrsh7th/cmp-path :HiPhish/rainbow-delimiters.nvim {}
:hrsh7th/cmp-vsnip :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer
:hrsh7th/vim-vsnip-integ :hrsh7th/cmp-emoji
:L3MON4D3/LuaSnip :hrsh7th/cmp-nvim-lsp
:PaterJason/cmp-conjure :hrsh7th/cmp-nvim-lua
:saadparwaiz1/cmp_luasnip] :hrsh7th/cmp-path
:mod :cmp} :hrsh7th/cmp-vsnip
:hrsh7th/vim-vsnip {} :hrsh7th/vim-vsnip-integ
:hrsh7th/vim-vsnip-integ {} :L3MON4D3/LuaSnip
:Iron-E/nvim-soluarized {} :PaterJason/cmp-conjure
:jiangmiao/auto-pairs {} :saadparwaiz1/cmp_luasnip]
:jose-elias-alvarez/null-ls.nvim {:mod :null-ls :mod :cmp}
:requires [:nvim-lua/plenary.nvim]} :hrsh7th/vim-vsnip {}
:junegunn/vim-easy-align {:mod :easyalign} :hrsh7th/vim-vsnip-integ {}
:kovisoft/paredit {:mod :paredit} :Iron-E/nvim-soluarized {}
:kristijanhusak/vim-dadbod-completion {} :jiangmiao/auto-pairs {}
:kristijanhusak/vim-dadbod-ui {} :nvimtools/none-ls.nvim {:mod :null-ls
:L3MON4D3/LuaSnip {:mod :luasnip} :requires [:nvim-lua/plenary.nvim]}
:lifepillar/vim-solarized8 {} :junegunn/vim-easy-align {:mod :easyalign}
:lukas-reineke/headlines.nvim {:mod :headlines} :kovisoft/paredit {:mod :paredit
; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun} :require [:nvim-treesitter/nvim-treesitter]}
:neovim/nvim-lspconfig {:mod :lspconfig} :kristijanhusak/vim-dadbod-completion {}
:norcalli/nvim-colorizer.lua {:mod :colorizer} :kristijanhusak/vim-dadbod-ui {}
:nvim-orgmode/orgmode {:mod :orgmode} :L3MON4D3/LuaSnip {:mod :luasnip}
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] :lifepillar/vim-solarized8 {}
[:nvim-lua/plenary.nvim]] :lukas-reineke/headlines.nvim {:mod :headlines}
:mod :telescope} ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mrjones2014/smart-splits.nvim {:mod :smartsplits}
:mod :treesitter} :mechatroner/rainbow_csv {}
:nvim-treesitter/playground {} :MunifTanjim/nui.nvim {}
:p00f/nvim-ts-rainbow {} :neovim/nvim-lspconfig {:mod :lspconfig}
:radenling/vim-dispatch-neovim {} :norcalli/nvim-colorizer.lua {:mod :colorizer}
:rafamadriz/friendly-snippets {} :nvim-neo-tree/neo-tree.nvim {:branch :v3.x
:skywind3000/asyncrun.vim {} :require [:nvim-lua/plenary.nvim
:tjdevries/sg.nvim {:run "cargo build --workspace" :nvim-tree/nvim-web-devicons
:dependencies [:nvim-lua/plenary.nvim]} ; not strictly required, but recommended
:tpope/vim-classpath {} :MunifTanjim/nui.nvim
:tpope/vim-dadbod {} ; :3rd/image.nvim, ; Optional image support in preview window: See `# Preview Mode` for more information
:tpope/vim-dispatch {} ]}
:tpope/vim-fugitive {:mod :fugitive} :nvim-orgmode/orgmode {:mod :orgmode}
:tpope/vim-git {} :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim]
:tpope/vim-pathogen {} [:nvim-lua/plenary.nvim]]
:tpope/vim-rails {} :mod :telescope}
:tpope/vim-repeat {} :nvim-tree/nvim-web-devicons {}
:tpope/vim-surround {} :nvim-treesitter/nvim-treesitter {:run ":TSUpdate"
:tpope/vim-unimpaired {} :mod :treesitter}
:tpope/vim-vinegar {} :nvim-treesitter/playground {}
:wbthomason/packer.nvim {:mod :packer} :radenling/vim-dispatch-neovim {}
;; :williamboman/nvim-lsp-installbuilder {} :RaafatTurki/hex.nvim {:mod :hex}
:williamboman/mason.nvim {:mod :mason :rafamadriz/friendly-snippets {}
:requires [:williamboman/mason-lspconfig.nvim]} :skywind3000/asyncrun.vim {}
; NeoVim lsp server installs ;; :tjdevries/sg.nvim {:run "cargo build --workspace"
; :luochen1990/rainbow {} ;; :dependencies [:nvim-lua/plenary.nvim]}
; :thecontinium/asyncomplete-conjure.vim {} ;; :tpope/vim-classpath {}
} ; :tpope/vim-fireplace {} ; Clojure :tpope/vim-dadbod {}
; :tpope/vim-sexp-mappings-for-regular-people {} :tpope/vim-dispatch {}
) :tpope/vim-fugitive {:mod :fugitive}
:tpope/vim-git {}
:tpope/vim-pathogen {}
:tpope/vim-rails {}
:tpope/vim-repeat {}
:tpope/vim-rhubarb {}
:tpope/vim-surround {}
:tpope/vim-unimpaired {}
:tpope/vim-vinegar {}
:wbthomason/packer.nvim {:mod :packer}
;; :williamboman/nvim-lsp-installbuilder {}
:williamboman/mason.nvim {:mod :mason
:requires [:williamboman/mason-lspconfig.nvim
:neovim/nvim-lspconfig]}
; NeoVim lsp server installs
; :p00f/nvim-ts-rainbow {}
; :luochen1990/rainbow {}
; :thecontinium/asyncomplete-conjure.vim {}
; :jose-elias-alvarez/null-ls.nvim {:mod :null-ls
; :requires [:nvim-lua/plenary.nvim]}
}
; :tpope/vim-fireplace {} ; Clojure ; :tpope/vim-sexp-mappings-for-regular-people {}
)
(use packages) (use packages)

View File

@@ -1,22 +1,14 @@
(module dotfiles.terraform-helpers (fn append-to-buf [bufno lines]
{autoload {a aniseed.core} (when lines
require {anenv aniseed.env (vim.aip.nvim_buf_set_lines bufno -1 -1 false lines)))
nvim aniseed.nvim
nu aniseed.nvim.util
u dotfiles.util}})
(defn append-to-buf [bufno lines]
(when lines
(nvim.buf_set_lines buffno -1 -1 false lines)))
(var tf-log-bufno nil) (var tf-log-bufno nil)
(defn tf-log-buffer [])
(defn terraform-import []
(vim.fn.jobstart [:terraform :import :-no-color address id]
{:stdout_buffered true
:on_stdout (fn [_ data]
(append-to-buf bufno data))}))
;; (fn terraform-import []
;; (vim.fn.jobstart [:terraform :import :-no-color address id]
;; {:stdout_buffered true
;; :on_stdout (fn [_ data]
;; (append-to-buf tf-log-bufno data))}))
;;
; (nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false}) ; (nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false})
; (u.nnoremap :<C-W>z ":call ZoomToggle()<CR>") ; (u.nnoremap :<C-W>z ":call ZoomToggle()<CR>")

View File

@@ -1,12 +1,15 @@
(module dotfiles.ts-utils {autoload {nvim aniseed.nvim a aniseed.core}}) (local core (require :nfnl.core))
(defn root [bufnr lang] (let [parser (vim.treesitter.get_parser bufnr lang {}) (fn root [bufnr lang]
tree (a.first (: parser :parse))] (let [parser (vim.treesitter.get_parser bufnr lang {})
(: tree :root))) tree (core.first (: parser :parse))]
(: tree :root)))
(defn make-query [lang query-string] (fn make-query [lang query-string]
(let [query (vim.treesitter.parse_query lang "(headline (stars) @stars)")] (let [query (vim.treesitter.query.parse lang "(headline (stars) @stars)")]
(fn [bufnr] (fn [bufnr]
(let [root-node (root bufnr lang) (let [root-node (root bufnr lang)
iter-captures (query.iter_captures query root-node bufnr 0 -1)] iter-captures (query.iter_captures query root-node bufnr 0 -1)]
iter-captures)))) iter-captures))))
{: root : make-query}

View File

@@ -1,23 +1,40 @@
(module dotfiles.util (local a (require :nfnl.core))
{autoload
{a aniseed.core}
require
{nvim aniseed.nvim}})
(fn fn? [x]
(= :function (type x)))
(defn noremap [mode from to opts] (fn noremap [mode from to opts]
(let [map-opts {:noremap true :silent true} (let [local? (a.get opts :local?)
to (.. ":" to "<cr>") opts (a.assoc opts :local? nil)
map-opts (a.merge opts {:noremap true :silent true})
to (if (fn? to)
to
(.. ":" to :<cr>))
buff-num (a.get opts :buff-num)] buff-num (a.get opts :buff-num)]
(if (or (a.get opts :local?) buff-num ) (if (or local? buff-num)
(nvim.buf_set_keymap (or buff-num 0) mode from to map-opts) (vim.keymap.set mode from to
(nvim.set_keymap mode from to map-opts)))) (a.merge map-opts {:buffer (or buff-num 0)}))
(vim.keymap.set mode from to map-opts))))
(defn nnoremap [from to opts] (fn nnoremap [from to opts] (noremap :n from to opts))
(noremap :n from to opts))
(defn lnnoremap [from to] (fn tnoremap [from to opts] (noremap :t from to opts))
(nnoremap (.. "<leader>" from) to))
(defn lvnoremap [from to opts] (fn inoremap [from to opts] (noremap :i from to opts))
(noremap :v (.. "<leader>" from) to opts))
(fn vnoremap [from to opts] (noremap :v from to opts))
(fn lnnoremap [from to opts] (nnoremap (.. :<leader> from) to opts))
(fn ltnoremap [from to opts] (noremap :v (.. :<leader> from) to opts))
(fn lvnoremap [from to opts] (noremap :t (.. :<leader> from) to opts))
{: noremap
: nnoremap
: tnoremap
: inoremap
: vnoremap
: lnnoremap
: ltnoremap
: lvnoremap}

View File

@@ -1,24 +1,18 @@
(module dotfiles.zoom-toggle (local u (require :dotfiles.util))
{autoload
{a aniseed.core}
require
{anenv aniseed.env
nvim aniseed.nvim
nu aniseed.nvim.util
u dotfiles.util}})
(var unzoom! nil) (var unzoom! nil)
(defn zoom-toggle [] (fn zoom-toggle []
(if unzoom! (if unzoom!
(do (do
(nvim.command unzoom!) (vim.cmd unzoom!)
(set unzoom! nil)) (set unzoom! nil))
(do (do
(set unzoom! (nvim.fn.winrestcmd)) (set unzoom! (vim.fn.winrestcmd))
(nvim.ex.resize) (vim.fn.resize)
(nvim.ex.vertical :resize)))) (vim.fn.vertical :resize))))
(vim.api.nvim_create_user_command :ZoomToggle zoom-toggle {})
(nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false}) (u.nnoremap :<M-z> ":call ZoomToggle()<CR>")
(u.nnoremap :<C-W>z ":call ZoomToggle()<CR>") (u.tnoremap :<M-z> "<c-\\><c-n>:call ZoomToggle()<CR>")

View File

@@ -4,7 +4,7 @@ local fn = vim.fn
local pack_path = fn.stdpath("data") .. "/site/pack" local pack_path = fn.stdpath("data") .. "/site/pack"
local fmt = string.format local fmt = string.format
function ensure (user, repo) function ensure(user, repo)
-- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory. -- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory.
local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo) local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo)
if fn.empty(fn.glob(install_path)) > 0 then if fn.empty(fn.glob(install_path)) > 0 then
@@ -15,10 +15,13 @@ end
-- Bootstrap essential plugins required for installing and loading the rest. -- Bootstrap essential plugins required for installing and loading the rest.
ensure("wbthomason", "packer.nvim") ensure("wbthomason", "packer.nvim")
ensure("Olical", "aniseed") -- ensure("Olical", "aniseed")
ensure("lifepillar", "vim-solarized8")
-- Enable Aniseed's automatic compilation and loading of Fennel source code. -- Enable Aniseed's automatic compilation and loading of Fennel source code.
vim.g["aniseed#env"] = { -- vim.g["aniseed#env"] = {
module = "dotfiles.init", -- module = "dotfiles.init",
compile = true -- compile = true
} -- }
--
require 'dotfiles.init'

View File

@@ -0,0 +1,30 @@
-- [nfnl] fnl/dotfiles/conceal.fnl
local u = require("dotfiles.util")
local conceals = {defn = "\240\157\145\147", fn = "\206\187", lambda = "\206\187", ["and"] = "\226\136\167", ["&&"] = "\226\136\167", ["or"] = "\226\136\168", ["||"] = "\226\136\168", ["not"] = "\194\172", ["!"] = "\194\172", ["for"] = "\226\136\128", ["in"] = "\226\136\136", ["true"] = "\226\138\164", ["false"] = "\226\138\165"}
local function setup_conceals()
vim.fn.clearmatches()
for the_match, replacement in pairs(conceals) do
local the_match0 = ("\\<" .. the_match .. "\\>")
vim.fn.matchadd("Conceal", the_match0, 0, -1, {conceal = replacement})
end
vim.wo.conceallevel = 2
vim.wo.concealcursor = "nvc"
return nil
end
local function toggle_conceal()
if (0 == vim.wo.conceallevel) then
vim.wo.conceallevel = 2
return nil
else
vim.wo.conceallevel = 0
return nil
end
end
vim.api.nvim_create_user_command("ToggleConceal", toggle_conceal, {})
vim.api.nvim_create_user_command("SetupConceals", setup_conceals, {})
u.nnoremap("<leader>ts", "call ToggleConceal()")
local pretty_filetypes = {"fennel", "clojure"}
for _, ftype in pairs(pretty_filetypes) do
vim.api.nvim_create_autocmd({"FileType"}, {pattern = ftype, callback = setup_conceals})
end
return {["setup-conceals"] = setup_conceals}

View File

@@ -0,0 +1,46 @@
-- [nfnl] fnl/dotfiles/core.fnl
local a = require("nfnl.core")
local u = require("dotfiles.util")
vim.cmd.set("shortmess+=c")
vim.cmd.set("path+=**")
vim.cmd.set("wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*")
local function safe_source(filename)
local glob = vim.fn.glob(filename)
if not a["empty?"](glob) then
return vim.fn.source(filename)
else
return nil
end
end
local backup_dir = (vim.fn.glob("$HOME") .. "/.vim/backup")
local undo_dir = (vim.fn.glob("$HOME") .. "/.vim/backup")
local on_opts = {"autoindent", "autoread", "expandtab", "exrc", "hlsearch", "ignorecase", "incsearch", "number", "ruler", "secure", "shiftround", "showcmd", "showmatch", "smartcase", "splitbelow", "splitright", "termguicolors", "title", "undofile", "wildmenu"}
local val_based_opts = {laststatus = 2, encoding = "utf-8", history = 500, redrawtime = 5000, scrolloff = 3, guifont = "Hasklig", guifontwide = "Hasklig", background = "dark", backupdir = backup_dir, directory = backup_dir, grepprg = "ag --vimgrep", tags = "tags", updatetime = 300, signcolumn = "auto:1-3", colorcolumn = {81, 100}, cmdheight = 2, undodir = undo_dir, undolevels = 1000, undoreload = 10000, foldmethod = "expr", foldexpr = "nvim_treesitter#foldexpr()", foldlevelstart = 100, foldlevel = 99, tabstop = 2, shiftwidth = 2, softtabstop = 2, mouse = "", list = true, listchars = "tab:\226\158\165\\ ,trail:\194\183,nbsp:\226\150\160", backspace = "indent,eol,start", wildmode = "list:longest,list:full", wrap = false}
local append_val_opts = {diffopt = "algorithm:patience"}
local function set_opt(_2_)
local opt = _2_[1]
local val = _2_[2]
vim.opt[a.str(opt)] = val
return nil
end
local function set_opt_2b(_3_)
local opt = _3_[1]
local val = _3_[2]
local existing_opt_val = a.get(vim.o, opt)
vim.opt[a.str(opt)] = a.str(existing_opt_val, ",", val)
return nil
end
local function set_opt_on(opt)
return set_opt({opt, true})
end
a.map(set_opt_on, on_opts)
a["map-indexed"](set_opt, val_based_opts)
a["map-indexed"](set_opt_2b, append_val_opts)
vim.cmd.syntax("on")
vim.cmd.colorscheme("solarized8")
vim.api.nvim_create_autocmd({"vimenter"}, {pattern = "*", command = "colorscheme solarized8", nested = true})
local function make_fennel_scratch()
return vim.cmd("new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel")
end
vim.api.nvim_create_user_command("FennelScratchBuffer", make_fennel_scratch, {})
return u.nnoremap("<leader>fsb", ":call FennelScratchBuffer ()<CR>")

View File

@@ -0,0 +1,23 @@
-- [nfnl] fnl/dotfiles/init.fnl
local a = require("nfnl.core")
local str = require("nfnl.string")
local fs = require("nfnl.fs")
local function require_all()
local require_exclusions = a["->set"]({"init"})
local function _1_(_241)
return ("dotfiles." .. _241)
end
local function _2_(_241)
return not a["contains?"](require_exclusions, _241)
end
local function _3_(_241)
return a.first(str.split(_241, ".fnl"))
end
return a.map(_1_, a.filter(_2_, a.map(_3_, fs.relglob("fnl/dotfiles", "*.fnl"))))
end
require("dotfiles.core")
require("dotfiles.plugins")
require("dotfiles.mapping")
require("dotfiles.conceal")
require("dotfiles.zoom-toggle")
return a.println("(re)loaded")

View File

@@ -0,0 +1,38 @@
-- [nfnl] fnl/dotfiles/mapping.fnl
local util = require("dotfiles.util")
local nfnl = require("nfnl.api")
local function noremap(mode, from, to)
return vim.keymap.set(mode, from, to, {noremap = true})
end
local function _1_()
nfnl["compile-all-files"](vim.fn.stdpath("config"))
return vim.cmd.source((vim.fn.stdpath("config") .. "/init.lua"))
end
vim.keymap.set("n", "<leader>`", _1_)
noremap("n", "<Enter>", ":nohlsearch<Enter>/<BS>")
noremap("n", "<leader>zz", ":normal! 1z=<cr>")
noremap("i", "<C-V><C-O>", ":set paste<CR><C-R><C-R>+<C-O>:set nopaste<CR>")
noremap("n", "<F5>", "\"=strftime(\"%F\")<CR>p")
noremap("i", "<F5>", "<C-R>=strftime(\"%F\")<CR>")
noremap("n", "<M-5>", "\"=trim(system('date -u'))<CR>p")
noremap("i", "<M-5>", "<C-R>=trim(system('date -u'))<CR>")
noremap("v", "<leader>ah", "S<a href=\"\" target=\"_blank\" rel=\"nopener noreferrer\"><CR>")
noremap("v", "<leader>ml", "xi[<c-r>\"]()<esc>")
noremap("n", "<C-e>", "3<C-e>")
noremap("n", "<C-y>", "3<C-y>")
noremap("n", "<C-k>", "[e")
noremap("n", "<C-j>", "]e")
noremap("v", "<C-k>", "[egv")
noremap("v", "<C-j>", "]egv")
noremap("n", "<leader>jpp", ":%!python -m json.tool --indent=2<CR>")
noremap("c", "w!!", "w !sudo tee % >/dev/null")
noremap("n", "gnh", ":GitGutterNextHunk<CR>")
noremap("n", "gph", ":GitGutterPrevHunk<CR>")
noremap("n", "gsh", ":GitGutterStageHunk<CR>")
noremap("n", "<leader>mv", ":AsyncRun -mode=bang open -a Marked\\ 2.app '%:p'<cr>")
vim.api.nvim_create_autocmd({"FileType"}, {pattern = "sql", command = "nmap <leader>s vap<leader>S"})
noremap("n", "Q", ":.!bash <CR>")
util.lvnoremap("tw", "<C-U>s/\\s\\+$//ge<CR>:nohlsearch<Enter>/<BS>")
util.lnnoremap("tw", "<C-U>.s/\\s\\+$//ge<CR>:nohlsearch<Enter>/<BS>")
util.lnnoremap("<C-k>", ":set scrollback=1 | :set scrollback 100000<cr>", {silent = true})
return util.ltnoremap("<C-k>", "<C-\\><C-n><leader><C-l>i", {silent = true})

View File

@@ -0,0 +1,18 @@
-- [nfnl] fnl/dotfiles/plugin/cmp.fnl
local cmp = require("cmp")
local luasnip = require("luasnip")
local cmp_src_menu_items = {buffer = "buff", conjure = "conj", nvim_lsp = "lsp"}
local cmp_srcs = {{name = "nvim_lsp"}, {name = "nvim_lua"}, {name = "luasnip"}, {name = "vsnip"}, {name = "conjure"}, {name = "buffer"}, {name = "orgmode"}, {name = "emoji", max_item_count = 8}}
local cmp0 = require("cmp")
local function _1_(entry, item)
item.menu = (cmp_src_menu_items[entry.source.name] or "")
return item
end
local function _2_(args)
if args then
return luasnip.lsp_expand(args.body)
else
return nil
end
end
return cmp0.setup({formatting = {format = _1_}, mapping = {["<C-p>"] = cmp0.mapping.select_prev_item(), ["<C-n>"] = cmp0.mapping.select_next_item(), ["<C-b>"] = cmp0.mapping.scroll_docs(( - 4)), ["<C-f>"] = cmp0.mapping.scroll_docs(4), ["<C-Space>"] = cmp0.mapping.complete(), ["<C-e>"] = cmp0.mapping.close(), ["<C-y>"] = cmp0.mapping.confirm({select = true})}, snippet = {expand = _2_}, sources = cmp_srcs})

View File

@@ -0,0 +1,3 @@
-- [nfnl] fnl/dotfiles/plugin/colorizer.fnl
local colorizer = require("colorizer")
return colorizer.setup({"*"}, {RGB = true, RRGGBB = true, names = true, RRGGBBAA = true, rgb_fn = true, hsl_fn = true, css = true, css_fn = true})

View File

@@ -0,0 +1,8 @@
-- [nfnl] fnl/dotfiles/plugin/conjure.fnl
local core = require("nfnl.core")
local conjure_config = require("conjure.config")
vim.g["conjure#mapping#doc_word"] = "gk"
vim.g["conjure#client#clojure#nrepl#mapping#session_clone"] = "sC"
vim.g["conjure#extract#tree_sitter#enabled"] = true
conjure_config["assoc-in"]({"filetypes"}, core.concat(conjure_config.filetypes(), {"markdown"}))
return conjure_config["assoc-in"]({"filetype", "markdown"}, "conjure.client.clojure.nrepl")

View File

@@ -0,0 +1,2 @@
-- [nfnl] fnl/dotfiles/plugin/dadbodui.fnl

View File

@@ -0,0 +1,3 @@
-- [nfnl] fnl/dotfiles/plugin/easyalign.fnl
local util = require("dotfiles.util")
return util.noremap("v", "<leader><bslash>", "EasyAlign*<Bar>")

View File

@@ -0,0 +1,11 @@
-- [nfnl] fnl/dotfiles/plugin/fugitive.fnl
local util = require("dotfiles.util")
local function bufmap(mode, from, to)
return util.noremap(mode, from, to, {["local?"] = true})
end
local function map_fugitive_keys()
bufmap("n", "<leader>gp", ":Git pull<CR>")
bufmap("n", "<leader>gP", ":Git push<CR>")
return bufmap("n", "<leader>gF", ":Git push -f<CR>")
end
return vim.api.nvim_create_autocmd({"FileType"}, {pattern = "fugitive", callback = map_fugitive_keys})

View File

@@ -0,0 +1,3 @@
-- [nfnl] fnl/dotfiles/plugin/headlines.fnl
local headlines = require("headlines")
return nil

View File

@@ -0,0 +1,7 @@
-- [nfnl] fnl/dotfiles/plugin/hex.fnl
local hex = require("hex")
if hex then
return hex.setup()
else
return nil
end

View File

@@ -0,0 +1,153 @@
-- [nfnl] fnl/dotfiles/plugin/lspconfig.fnl
local a = require("nfnl.core")
local u = require("dotfiles.util")
local lsp = require("vim.lsp")
local lspconfig = require("lspconfig")
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local function bufmap(mode, from, to, opts)
return u.noremap(mode, from, to, a.merge({["local?"] = true}, opts))
end
local function nbufmap(from, to, opts)
return bufmap("n", from, to, opts)
end
local function xbufmap(from, to, opts)
return bufmap("x", from, to, opts)
end
local function lsp_execute_command(client, cmd, ...)
local buf_uri = vim.uri_from_bufnr(0)
local cursor = vim.api.nvim_win_get_cursor(0)
local r = (a.first(cursor) - 1)
local c = a.second(cursor)
local opts = {buf_uri, r, c}
local args = a.concat(opts, {...})
return client.request_sync("workspace/executeCommand", {command = cmd, arguments = args}, nil, 0)
end
vim.diagnostic.config({signs = {text = {[vim.diagnostic.severity.ERROR] = "\226\152\162\239\184\143", [vim.diagnostic.severity.WARN] = "\226\154\160\239\184\143", [vim.diagnostic.severity.INFO] = "\226\132\185\239\184\143", [vim.diagnostic.severity.HINT] = "\240\159\148\142"}}})
local core_nmappings = {gd = "lua vim.lsp.buf.definition()", gD = "lua vim.lsp.buf.declaration()", gi = "lua vim.lsp.buf.implementation()", gr = "lua vim.lsp.buf.references()", K = "lua vim.lsp.buf.hover()", ["[g"] = "lua vim.diagnostic.goto_prev()", ["]g"] = "lua vim.diagnostic.goto_next()", ["<leader>ca"] = "lua vim.lsp.buf.code_action()", ["<leader>cl"] = "lua vim.lsp.codelens.run()", ["<leader>ic"] = "lua vim.lsp.buf.incoming_calls()", ["<leader>sld"] = "lua vim.diagnostic.open_float(nil, {source = 'always'})", ["<leader>rn"] = "lua vim.lsp.buf.rename()", ["<leader>fa"] = "lua vim.lsp.buf.format()"}
local client_nmappings = {clojure_lsp = {}}
local client_command_lnmappings
local function _1_()
return vim.fn.input("Namespace name: ")
end
local function _2_()
return vim.fn.input("Namespace name: ")
end
local function _3_()
return vim.fn.input("Namespace as: ")
end
local function _4_()
return vim.fn.input("Namespace name: ")
end
local function _5_()
return vim.fn.input("Definition name: ")
end
local function _6_()
return vim.fn.input("Function name: ")
end
local function _7_()
return vim.fn.input("Binding name: ")
end
local function _8_()
return vim.fn.input("File name: ")
end
local function _9_()
return vim.fn.input("Binding name: ")
end
local function _10_()
return vim.fn.input("Function name: ")
end
local function _11_()
return vim.fn.input("")
end
client_command_lnmappings = {clojure_lsp = {ai = {"add-import-to-namespace", {_1_}}, am = {"add-missing-libspec", {}}, as = {"add-require-suggestion", {_2_, _3_, _4_}}, cc = {"cycle-coll", {}}, cn = {"clean-ns", {}}, cp = {"cycle-privacy", {}}, ct = {"create-test", {}}, df = {"drag-forward", {}}, db = {"drag-backward", {}}, dk = {"destructure-keys", {}}, ed = {"extract-to-def", {_5_}}, ref = {"extract-function", {_6_}}, el = {"expand-let", {}}, fe = {"create-function", {}}, il = {"introduce-let", {_7_}}, is = {"inline-symbol", {}}, ma = {"resolve-macro-as", {}}, mf = {"move-form", {_8_}}, ml = {"move-to-let", {_9_}}, pf = {"promote-fn", {_10_}}, sc = {"change-collection", {_11_, "input('Collection type: ')"}}, sm = {"sort-map", {}}, tf = {"thread-first-all", {}}, tF = {"thread-first", {}}, tl = {"thread-last-all", {}}, tL = {"thread-last", {}}, ua = {"unwind-all", {}}, uw = {"unwind-thread", {}}}}
local server_specific_opts = {}
local function bind_client_mappings(client)
local client_name = a.get(client, "name")
local mappings = a.get(client_nmappings, client_name)
local command_lnmappings = a.get(client_command_lnmappings, client_name)
if mappings then
for mapping, cmd in pairs(mappings) do
nbufmap(mapping, cmd, {})
end
else
end
if command_lnmappings then
for lnmapping, command_mapping in pairs(command_lnmappings) do
local lsp_cmd = a.first(command_mapping)
local mapping = ("<leader>" .. lnmapping)
local cmd
local function _13_()
local opts
do
local s = ""
for _i, opt in ipairs(a.second(command_mapping)) do
local _14_
if ("function" == type(opt)) then
_14_ = opt()
else
_14_ = opt
end
s = (s .. _14_)
end
opts = s
end
return lsp_execute_command(client, lsp_cmd, opts)
end
cmd = _13_
nbufmap(mapping, cmd, {desc = ("LSP command `" .. lsp_cmd .. "`")})
end
return nil
else
return nil
end
end
local function on_attach(client, bufnr)
for mapping, cmd in pairs(core_nmappings) do
nbufmap(mapping, cmd, {})
end
xbufmap("<leader>fa", "lua vim.lsp.buf.format()", {desc = "Format buffer"})
vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", {buf = 0})
bind_client_mappings(client)
if client.server_capabilities.documentHighlightProvider then
for hlgroup, base_group in pairs({LspReferenceRead = "SpecialKey", LspReferenceText = "SpecialKey", LspReferenceWrite = "SpecialKey"}) do
vim.api.nvim_set_hl(0, hlgroup, a.merge(vim.api.nvim_get_hl_by_name(base_group, true), {italic = true, foreground = "#6c71c4", background = "NONE"}))
end
local group = vim.api.nvim_create_augroup("LspDocumentHighlight", {clear = true})
local function _17_()
return vim.lsp.buf.document_highlight()
end
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {group = group, pattern = "<buffer>", callback = _17_})
local function _18_()
return vim.lsp.buf.clear_references()
end
vim.api.nvim_create_autocmd({"CursorMoved"}, {group = group, pattern = "<buffer>", callback = _18_})
else
end
if client.server_capabilities.documentFormattingProvider then
local function _20_()
return vim.lsp.buf.format()
end
vim.api.nvim_create_autocmd({"BufWritePre"}, {pattern = "<buffer>", callback = _20_})
else
end
return print("LSP Client Attached.")
end
local base_server_opts
do
local capabilities = cmp_nvim_lsp.default_capabilities(lsp.protocol.make_client_capabilities())
base_server_opts = {on_attach = on_attach, capabilities = capabilities, flags = {debounce_text_changes = 150}}
end
local function default_server_handler(server_name)
local specific_opts = a.get(server_specific_opts, server_name, {})
local server_opts = a.merge(base_server_opts, specific_opts)
return vim.lsp.config(server_name, server_opts)
end
local function setup_handlers(language_servers)
for _, server_name in pairs(language_servers) do
default_server_handler(server_name)
end
return nil
end
u.nnoremap("<leader>li", "LspInfo")
vim.api.nvim_create_user_command("LspExecuteCommand", lsp_execute_command, {nargs = "+"})
return {on_attach = on_attach, ["default-server-handler"] = default_server_handler, ["setup-handlers"] = setup_handlers}

View File

@@ -0,0 +1,32 @@
-- [nfnl] fnl/dotfiles/plugin/luasnip.fnl
local luasnip = require("luasnip")
local select_choice = require("luasnip.extras.select_choice")
if luasnip then
local function _1_()
if luasnip.expand_or_jumpable() then
return luasnip.expand_or_jump()
else
return nil
end
end
vim.keymap.set({"i", "s"}, "<C-k>", _1_, {silent = true})
local function _3_()
if luasnip.jumpable(-1) then
return luasnip.jump(-1)
else
return nil
end
end
vim.keymap.set({"i", "s"}, "<C-j>", _3_, {silent = true})
local function _5_()
if luasnip.choice_active() then
return luasnip.choice(1)
else
return nil
end
end
vim.keymap.set("i", "<C-l>", _5_)
return vim.keymap.set("i", "<C-u>", select_choice)
else
return nil
end

View File

@@ -0,0 +1,14 @@
-- [nfnl] fnl/dotfiles/plugin/mason.fnl
local mason = require("mason")
local mason_lspconf = require("mason-lspconfig")
local lspconfig = require("dotfiles.plugin.lspconfig")
local function setup()
mason.setup({ui = {icons = {package_installed = "\226\156\147"}}})
if mason_lspconf then
mason_lspconf.setup({ensure_installed = {"lua_ls"}, automatic_enable = true})
return lspconfig["setup-handlers"](mason_lspconf.get_installed_servers())
else
return nil
end
end
return setup()

View File

@@ -0,0 +1,3 @@
-- [nfnl] fnl/dotfiles/plugin/nfnl.fnl
local nfnl = require("nfnl")
return nfnl.setup({compile_on_write = true})

View File

@@ -0,0 +1,9 @@
-- [nfnl] fnl/dotfiles/plugin/null-ls.fnl
local null_ls = require("null-ls")
local lspconfig = require("dotfiles.plugin.lspconfig")
if null_ls then
local null_ls_server_options = {sources = {null_ls.builtins.formatting.stylua, null_ls.builtins.formatting.fnlfmt}, on_attach = lspconfig.on_attach}
return null_ls.setup(null_ls_server_options)
else
return nil
end

View File

@@ -0,0 +1,41 @@
-- [nfnl] fnl/dotfiles/plugin/orgbullets.fnl
local core = require("nfnl.core")
local conceal = require("dotfiles.conceal")
local ts_utils = require("dotfiles.ts-utils")
local stars = {"\226\151\137", "\226\166\190", "\226\151\139", "\226\156\184", "\226\156\191", "\226\156\182", "\226\128\162", "\226\128\163"}
local stars_query = "(headline (stars) @stars)"
local function star_index(heading_level)
local star_count = core.count(stars)
local idx = math.fmod(heading_level, star_count)
if (0 < idx) then
return idx
else
return star_count
end
end
local extmark_namespace = vim.api.nvim_create_namespace("HeaderStars")
local star_captures = ts_utils["make-query"]("org", stars_query)
local function gen_star_extmarks()
if ("org" == vim.bo.filetype) then
local bufnr = vim.api.nvim_get_current_buf()
local star_count = core.count(stars)
vim.api.nvim_buf_clear_namespace(bufnr, extmark_namespace, 0, -1)
for id, node, metadata in star_captures(bufnr) do
local start_line,start_col,end_row,end_col = node:range()
local heading_level
if (start_line == end_row) then
heading_level = (end_col - start_col)
else
heading_level = nil
end
local star = core.get(stars, star_index(heading_level))
local replacement = string.format(core.str("%", (2 + heading_level), "s"), star)
vim.api.nvim_buf_set_extmark(bufnr, extmark_namespace, start_line, start_col, {end_col = end_col, end_row = end_row, virt_text = {{replacement, {}}}, virt_text_pos = "overlay", hl_mode = "combine"})
end
return nil
else
return nil
end
end
local group = vim.api.nvim_create_augroup("HeaderStars", {clear = true})
return vim.api.nvim_create_autocmd({"FileChangedShellPost", "Syntax", "TextChanged", "InsertLeave", "WinScrolled"}, {group = group, callback = conceal["setup-conceals"]})

View File

@@ -0,0 +1,4 @@
-- [nfnl] fnl/dotfiles/plugin/orgmode.fnl
local orgmode = require("orgmode")
orgmode.setup({org_agenda_files = {"~/Dropbox/org/*", "~/my-orgs/**/*"}, org_default_notes_file = "~/Dropbox/org/refile.org", mappings = {org = {org_toggle_checkbox = "<C-.>"}}})
return require("dotfiles.plugin.orgbullets")

View File

@@ -0,0 +1,4 @@
-- [nfnl] fnl/dotfiles/plugin/packer.fnl
local u = require("dotfiles.util")
u.nnoremap("<leader>pi", "PackerInstall")
return u.nnoremap("<leader>pu", "PackerUpdate")

View File

@@ -0,0 +1,93 @@
-- [nfnl] fnl/dotfiles/plugin/paredit.fnl
local a = require("nfnl.core")
local treesitter = require("dotfiles.plugin.treesitter")
local ts_parsers = require("nvim-treesitter.parsers")
local ts_utils = require("nvim-treesitter.ts_utils")
local languagetree = require("vim.treesitter.languagetree")
vim.g.paredit_smartjump = 1
local function list_member_3f(xs, x)
local function _1_(_241)
return (x == _241)
end
return a.some(_1_, a.vals(xs))
end
local function bool__3eint(bool)
if bool then
return 1
else
return 0
end
end
local function int__3ebool(x)
if (0 == x) then
return false
else
return true
end
end
local function toggle_global_21(x)
vim.g[x] = bool__3eint(not int__3ebool(a.get(vim.g, x)))
return nil
end
local function language_at_cursor()
local parser = ts_parsers.get_parser()
local current_node = ts_utils.get_node_at_cursor()
local range
if current_node then
range = {current_node:range()}
else
range = nil
end
local lang
if range then
lang = languagetree.language_for_range(parser, range)
else
lang = nil
end
if lang then
return lang:lang()
else
return nil
end
end
local function parser_language()
local parser = ts_parsers.get_parser()
if parser then
return parser:lang()
else
return nil
end
end
local paredit_langs = {"clojure", "fennel", "hy", "janet", "julia", "lfe", "lisp", "racket", "scheme", "shen"}
local paredit_host_langs = {"org", "markdown", "asciidoc"}
local function host_lang_in_3f(langs)
return list_member_3f(langs, parser_language())
end
local function paredit_lang_3f(lang)
return list_member_3f(paredit_langs, lang)
end
local function TreeSitterLangParedit()
if host_lang_in_3f(paredit_host_langs) then
local cursor_lang = language_at_cursor()
if cursor_lang then
vim.g.paredit_mode = bool__3eint(paredit_lang_3f(cursor_lang))
return vim.fn.PareditInitBuffer()
else
return nil
end
else
return nil
end
end
local function _10_()
return vim.fn.PareditInitBalancingAllBracketsBuffer()
end
vim.api.nvim_create_autocmd({"FileType"}, {pattern = "ruby", callback = _10_})
local function _11_()
return vim.fn.PareditInitBalancingAllBracketsBuffer()
end
vim.api.nvim_create_autocmd({"FileType"}, {pattern = "javascript", callback = _11_})
local function _12_()
return vim.fn.PareditInitBalancingAllBracketsBuffer()
end
return vim.api.nvim_create_autocmd({"FileType"}, {pattern = "terraform", callback = _12_})

View File

@@ -0,0 +1,19 @@
-- [nfnl] fnl/dotfiles/plugin/smartsplits.fnl
local smart_splits = require("smart-splits")
if smart_splits then
smart_splits.setup()
vim.keymap.set("n", "<M-S-h>", smart_splits.resize_left)
vim.keymap.set("n", "<M-S-j>", smart_splits.resize_down)
vim.keymap.set("n", "<M-S-k>", smart_splits.resize_up)
vim.keymap.set("n", "<M-S-l>", smart_splits.resize_right)
vim.keymap.set("n", "<M-h>", smart_splits.move_cursor_left)
vim.keymap.set("n", "<M-j>", smart_splits.move_cursor_down)
vim.keymap.set("n", "<M-k>", smart_splits.move_cursor_up)
vim.keymap.set("n", "<M-l>", smart_splits.move_cursor_right)
vim.keymap.set("n", "<leader><leader>h", smart_splits.swap_buf_left)
vim.keymap.set("n", "<leader><leader>j", smart_splits.swap_buf_down)
vim.keymap.set("n", "<leader><leader>k", smart_splits.swap_buf_up)
return vim.keymap.set("n", "<leader><leader>l", smart_splits.swap_buf_right)
else
return nil
end

View File

@@ -0,0 +1,28 @@
-- [nfnl] fnl/dotfiles/plugin/telescope.fnl
local util = require("dotfiles.util")
local telescope = require("telescope")
local vimgrep_arguments = {"ag", "--nocolor", "--noheading", "--number", "--column", "--nobreak", "--smart-case", "--hidden", "--ignore", ".git", "--follow"}
telescope.load_extension("projects")
telescope.load_extension("yank_history")
telescope.setup({pickers = {buffers = {mappings = {n = {d = "delete_buffer"}}}}, extensions = {projects = {projects = {}}}})
util.lnnoremap("fc", "Telescope commands")
util.lnnoremap("fC", "Telescope command_history")
util.lnnoremap("ff", "Telescope git_files hidden=true")
util.lnnoremap("f-", "Telescope find_files")
util.lnnoremap("fg", "Telescope live_grep")
util.lnnoremap("*", "Telescope grep_string")
util.lnnoremap("fb", "Telescope buffers")
util.lnnoremap("fd", "Telescope diagnostics")
util.lnnoremap("fH", "Telescope help_tags")
util.lnnoremap("fh", "Telescope oldfiles")
util.lnnoremap("fp", "Telescope projects")
util.lnnoremap("fm", "Telescope keymaps")
util.lnnoremap("fM", "Telescope marks")
util.lnnoremap("ft", "Telescope filetypes")
util.lnnoremap("fq", "Telescope quickfix")
util.lnnoremap("fl", "Telescope loclist")
util.lnnoremap("fsi", "Telescope lsp_implementations")
util.lnnoremap("fsr", "Telescope lsp_references")
util.lnnoremap("fsS", "Telescope lsp_document_symbols")
util.lnnoremap("fss", "Telescope lsp_workspace_symbols")
return util.lnnoremap("fy", "Telescope yank_history")

View File

@@ -0,0 +1,14 @@
-- [nfnl] fnl/dotfiles/plugin/toggleterm.fnl
local toggleterm = require("toggleterm")
toggleterm.setup({open_mapping = "<c-\\>", start_in_insert = true, insert_mappings = true, terminal_mappings = true, persist_size = true, persist_mode = true, autochdir = true})
local function set_terminal_keymaps()
vim.keymap.set("t", "<esc>", "<C-\\><C-n>")
vim.keymap.set("t", "jk", "<C-\\><C-n>")
vim.keymap.set("t", "<C-h>", "<Cmd>wincmd h<CR>")
vim.keymap.set("t", "<C-j>", "<Cmd>wincmd j<CR>")
vim.keymap.set("t", "<C-k>", "<Cmd>wincmd k<CR>")
vim.keymap.set("t", "<C-l>", "<Cmd>wincmd l<CR>")
return vim.keymap.set("t", "<C-w>", "<C-\\><C-n><C-w>")
end
vim.api.nvim_create_user_command("SetTerminalKeymaps", set_terminal_keymaps, {})
return vim.api.nvim_create_autocmd({"TermOpen"}, {pattern = "term://*", callback = set_terminal_keymaps})

View File

@@ -0,0 +1,3 @@
-- [nfnl] fnl/dotfiles/plugin/treesitter.fnl
local treesitter_configs = require("nvim-treesitter.configs")
return treesitter_configs.setup({highlight = {enable = true, additional_vim_regex_highlighting = {"org"}}, ensure_installed = "all", rainbow = {enable = true, extended_mode = true, max_file_lines = 10000, colors = {"#dc322f", "#b58900", "#d33682", "#859900", "#2aa198", "#268bd2", "#6c71c4"}}})

View File

@@ -0,0 +1,7 @@
-- [nfnl] fnl/dotfiles/plugin/whichkey.fnl
local which_key = require("which-key")
if which_key then
return which_key.setup({})
else
return nil
end

View File

@@ -0,0 +1,23 @@
-- [nfnl] fnl/dotfiles/plugin/yanky.fnl
local yanky = require("yanky")
yanky.setup({ring = {history_length = 100, storage = "shada", sync_with_numbered_registers = true, cancel_event = "update"}, system_clipboard = {sync_with_ring = true}})
vim.keymap.set("n", "p", "<Plug>(YankyPutAfter)")
vim.keymap.set("n", "P", "<Plug>(YankyPutBefore)")
vim.keymap.set("n", "gp", "<Plug>(YankyGPutAfter)")
vim.keymap.set("n", "gP", "<Plug>(YankyGPutBefore)")
vim.keymap.set("n", "<c-n>", "<Plug>(YankyCycleForward)")
vim.keymap.set("n", "<c-p>", "<Plug>(YankyCycleBackward)")
vim.keymap.set("n", "]p", "<Plug>(YankyPutIndentAfterLinewise)")
vim.keymap.set("n", "[p", "<Plug>(YankyPutIndentBeforeLinewise)")
vim.keymap.set("n", "]P", "<Plug>(YankyPutIndentAfterLinewise)")
vim.keymap.set("n", "[P", "<Plug>(YankyPutIndentBeforeLinewise)")
vim.keymap.set("n", ">p", "<Plug>(YankyPutIndentAfterShiftRight)")
vim.keymap.set("n", "<p", "<Plug>(YankyPutIndentAfterShiftLeft)")
vim.keymap.set("n", ">P", "<Plug>(YankyPutIndentBeforeShiftRight)")
vim.keymap.set("n", "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)")
vim.keymap.set("n", "=p", "<Plug>(YankyPutAfterFilter)")
vim.keymap.set("n", "=P", "<Plug>(YankyPutBeforeFilter)")
vim.keymap.set("x", "p", "<Plug>(YankyPutAfter)")
vim.keymap.set("x", "P", "<Plug>(YankyPutBefore)")
vim.keymap.set("x", "gp", "<Plug>(YankyGPutAfter)")
return vim.keymap.set("x", "gP", "<Plug>(YankyGPutBefore)")

View File

@@ -0,0 +1,29 @@
-- [nfnl] fnl/dotfiles/plugins.fnl
local packer = require("packer")
local core = require("nfnl.core")
local function safe_require_plugin_config(name)
local ok_3f, val_or_err = pcall(require, ("dotfiles.plugin." .. name))
if not ok_3f then
return print(("dotfiles error: " .. val_or_err))
else
return nil
end
end
local function use(pkgs)
local function _2_(use0)
for name, opts in pairs(pkgs) do
do
local tmp_3_ = opts.mod
if (nil ~= tmp_3_) then
safe_require_plugin_config(tmp_3_)
else
end
end
use0(core.assoc(opts, 1, name))
end
return nil
end
return packer.startup(_2_)
end
local packages = {["Olical/nfnl"] = {}, ["Olical/conjure"] = {mod = "conjure"}, ["Olical/fennel.vim"] = {}, ["ahmedkhalf/project.nvim"] = {}, ["airblade/vim-gitgutter"] = {}, ["akinsho/toggleterm.nvim"] = {mod = "toggleterm"}, ["clojure-vim/vim-jack-in"] = {}, ["christianrondeau/vim-base64"] = {}, ["dhruvasagar/vim-table-mode"] = {}, ["folke/lsp-colors.nvim"] = {}, ["folke/which-key.nvim"] = {mod = "whichkey"}, ["gbprod/yanky.nvim"] = {mod = "yanky"}, ["hashivim/vim-terraform"] = {}, ["HiPhish/rainbow-delimiters.nvim"] = {}, ["hrsh7th/nvim-cmp"] = {requires = {"hrsh7th/cmp-buffer", "hrsh7th/cmp-emoji", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-path", "hrsh7th/cmp-vsnip", "hrsh7th/vim-vsnip-integ", "L3MON4D3/LuaSnip", "PaterJason/cmp-conjure", "saadparwaiz1/cmp_luasnip"}, mod = "cmp"}, ["hrsh7th/vim-vsnip"] = {}, ["hrsh7th/vim-vsnip-integ"] = {}, ["Iron-E/nvim-soluarized"] = {}, ["jiangmiao/auto-pairs"] = {}, ["nvimtools/none-ls.nvim"] = {mod = "null-ls", requires = {"nvim-lua/plenary.nvim"}}, ["junegunn/vim-easy-align"] = {mod = "easyalign"}, ["kovisoft/paredit"] = {mod = "paredit", require = {"nvim-treesitter/nvim-treesitter"}}, ["kristijanhusak/vim-dadbod-completion"] = {}, ["kristijanhusak/vim-dadbod-ui"] = {}, ["L3MON4D3/LuaSnip"] = {mod = "luasnip"}, ["lifepillar/vim-solarized8"] = {}, ["lukas-reineke/headlines.nvim"] = {mod = "headlines"}, ["mrjones2014/smart-splits.nvim"] = {mod = "smartsplits"}, ["mechatroner/rainbow_csv"] = {}, ["MunifTanjim/nui.nvim"] = {}, ["neovim/nvim-lspconfig"] = {mod = "lspconfig"}, ["norcalli/nvim-colorizer.lua"] = {mod = "colorizer"}, ["nvim-neo-tree/neo-tree.nvim"] = {branch = "v3.x", require = {"nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim"}}, ["nvim-orgmode/orgmode"] = {mod = "orgmode"}, ["nvim-telescope/telescope.nvim"] = {requires = {{"nvim-lua/popup.nvim"}, {"nvim-lua/plenary.nvim"}}, mod = "telescope"}, ["nvim-tree/nvim-web-devicons"] = {}, ["nvim-treesitter/nvim-treesitter"] = {run = ":TSUpdate", mod = "treesitter"}, ["nvim-treesitter/playground"] = {}, ["radenling/vim-dispatch-neovim"] = {}, ["RaafatTurki/hex.nvim"] = {mod = "hex"}, ["rafamadriz/friendly-snippets"] = {}, ["skywind3000/asyncrun.vim"] = {}, ["tpope/vim-dadbod"] = {}, ["tpope/vim-dispatch"] = {}, ["tpope/vim-fugitive"] = {mod = "fugitive"}, ["tpope/vim-git"] = {}, ["tpope/vim-pathogen"] = {}, ["tpope/vim-rails"] = {}, ["tpope/vim-repeat"] = {}, ["tpope/vim-rhubarb"] = {}, ["tpope/vim-surround"] = {}, ["tpope/vim-unimpaired"] = {}, ["tpope/vim-vinegar"] = {}, ["wbthomason/packer.nvim"] = {mod = "packer"}, ["williamboman/mason.nvim"] = {mod = "mason", requires = {"williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig"}}}
return use(packages)

View File

@@ -0,0 +1,10 @@
-- [nfnl] fnl/dotfiles/terraform-helpers.fnl
local function append_to_buf(bufno, lines)
if lines then
return vim.aip.nvim_buf_set_lines(bufno, -1, -1, false, lines)
else
return nil
end
end
local tf_log_bufno = nil
return nil

View File

@@ -0,0 +1,17 @@
-- [nfnl] fnl/dotfiles/ts-utils.fnl
local core = require("nfnl.core")
local function root(bufnr, lang)
local parser = vim.treesitter.get_parser(bufnr, lang, {})
local tree = core.first(parser:parse())
return tree:root()
end
local function make_query(lang, query_string)
local query = vim.treesitter.query.parse(lang, "(headline (stars) @stars)")
local function _1_(bufnr)
local root_node = root(bufnr, lang)
local iter_captures = query.iter_captures(query, root_node, bufnr, 0, -1)
return iter_captures
end
return _1_
end
return {root = root, ["make-query"] = make_query}

View File

@@ -0,0 +1,44 @@
-- [nfnl] fnl/dotfiles/util.fnl
local a = require("nfnl.core")
local function fn_3f(x)
return ("function" == type(x))
end
local function noremap(mode, from, to, opts)
local local_3f = a.get(opts, "local?")
local opts0 = a.assoc(opts, "local?", nil)
local map_opts = a.merge(opts0, {noremap = true, silent = true})
local to0
if fn_3f(to) then
to0 = to
else
to0 = (":" .. to .. "<cr>")
end
local buff_num = a.get(opts0, "buff-num")
if (local_3f or buff_num) then
return vim.keymap.set(mode, from, to0, a.merge(map_opts, {buffer = (buff_num or 0)}))
else
return vim.keymap.set(mode, from, to0, map_opts)
end
end
local function nnoremap(from, to, opts)
return noremap("n", from, to, opts)
end
local function tnoremap(from, to, opts)
return noremap("t", from, to, opts)
end
local function inoremap(from, to, opts)
return noremap("i", from, to, opts)
end
local function vnoremap(from, to, opts)
return noremap("v", from, to, opts)
end
local function lnnoremap(from, to, opts)
return nnoremap(("<leader>" .. from), to, opts)
end
local function ltnoremap(from, to, opts)
return noremap("v", ("<leader>" .. from), to, opts)
end
local function lvnoremap(from, to, opts)
return noremap("t", ("<leader>" .. from), to, opts)
end
return {noremap = noremap, nnoremap = nnoremap, tnoremap = tnoremap, inoremap = inoremap, vnoremap = vnoremap, lnnoremap = lnnoremap, ltnoremap = ltnoremap, lvnoremap = lvnoremap}

View File

@@ -0,0 +1,17 @@
-- [nfnl] fnl/dotfiles/zoom-toggle.fnl
local u = require("dotfiles.util")
local unzoom_21 = nil
local function zoom_toggle()
if unzoom_21 then
vim.cmd(unzoom_21)
unzoom_21 = nil
return nil
else
unzoom_21 = vim.fn.winrestcmd()
vim.fn.resize()
return vim.fn.vertical("resize")
end
end
vim.api.nvim_create_user_command("ZoomToggle", zoom_toggle, {})
u.nnoremap("<M-z>", ":call ZoomToggle()<CR>")
return u.tnoremap("<M-z>", "<c-\\><c-n>:call ZoomToggle()<CR>")

View File

@@ -1,6 +1,9 @@
set -g prefix C-a set -g prefix C-a
unbind C-b unbind C-b
set -g xterm-keys on
set -s extended-keys on
set -g history-file ~/.tmux_history set -g history-file ~/.tmux_history
set -s escape-time 1 set -s escape-time 1
@@ -36,7 +39,7 @@ setw -g mouse off
# set -g default-terminal "xterm-256:color" # set -g default-terminal "xterm-256:color"
# set -g default-terminal "${TERM}" # set -g default-terminal "${TERM}"
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -g history-limit 15000 set -g history-limit 55000
set -g window-status-style dim set -g window-status-style dim
set -g window-status-current-style bright set -g window-status-current-style bright
@@ -58,3 +61,31 @@ set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
set-option -g focus-events on set-option -g focus-events on
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-S-h if-shell "$is_vim" 'send-keys M-S-h' 'resize-pane -L 3'
bind-key -n M-S-j if-shell "$is_vim" 'send-keys M-S-j' 'resize-pane -D 3'
bind-key -n M-S-k if-shell "$is_vim" 'send-keys M-S-k' 'resize-pane -U 3'
bind-key -n M-S-l if-shell "$is_vim" 'send-keys M-S-l' 'resize-pane -R 3'
bind-key -n M-h if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n M-j if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n M-k if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n M-l if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'M-S-h' select-pane -L
bind-key -T copy-mode-vi 'M-S-j' select-pane -D
bind-key -T copy-mode-vi 'M-S-k' select-pane -U
bind-key -T copy-mode-vi 'M-S-l' select-pane -R
bind-key -T copy-mode-vi 'M-S-\' select-pane -l

View File

@@ -0,0 +1,8 @@
time_namelookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
----------\n
time_total: %{time_total}s\n

View File

@@ -0,0 +1,8 @@
time_namelookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
----------\n
time_total: %{time_total}s\n