mirror of
https://github.com/stevenproctor/dotfiles.git
synced 2026-01-28 17:39:56 -06:00
Compare commits
99 Commits
clojure_ma
...
07eb5d3b94
| Author | SHA1 | Date | |
|---|---|---|---|
| 07eb5d3b94 | |||
| 8186744af8 | |||
| acdba51080 | |||
| 9a79203170 | |||
| 24116f8264 | |||
| d3ebe7aef0 | |||
| c5c7d851dd | |||
| 4d3dc61c77 | |||
| bdb1fbdfd5 | |||
| e72ece36b1 | |||
| 7d4c4ae332 | |||
| ae35f5455e | |||
| 7444d89fad | |||
| 69e1b233d1 | |||
| 19930e36d5 | |||
| 5e5f6ffe49 | |||
| e89869917a | |||
| 80a417fec8 | |||
| 42dc9244be | |||
| f30097325b | |||
| 88200beefa | |||
| ea8112cf35 | |||
| cf9ef0b5e0 | |||
| 1200d06efc | |||
| c20fef8542 | |||
| 4d0512b9aa | |||
| c2d5402d28 | |||
| f4369a98ff | |||
| 037ad7d879 | |||
| 948c8b4345 | |||
| 9c7237c7e1 | |||
| ce6dca9733 | |||
| 6c0639068d | |||
| df8d793467 | |||
| 0d22d7fa46 | |||
| fa7904e131 | |||
| 9a302cb6c2 | |||
| 1a6c628b38 | |||
| 2b623f6eee | |||
| 07a92bb66c | |||
| d40878f48d | |||
| a23c581746 | |||
| 04bf501caa | |||
| b31ae70a7d | |||
| 04ffc88e9a | |||
| a47e5ab7a8 | |||
| e2bd2b2497 | |||
| b005718a80 | |||
| 5c2859dac6 | |||
| f58001e2ec | |||
| 2f2e7fb72d | |||
| 618d305a05 | |||
| 3c9383a552 | |||
| a61ba60adb | |||
| b762400ea9 | |||
| 5a77fa58e6 | |||
| f0fdde8b8b | |||
| 94c07708b6 | |||
| 1829789ed0 | |||
| f8c419314b | |||
| b504520573 | |||
| 44c4e29ebd | |||
| b08bb34014 | |||
| 7aee69c6cc | |||
| 00f9835648 | |||
| ada07b55ef | |||
| 1d0c8f99c0 | |||
| 40e12613f3 | |||
| 9aed0652fd | |||
| ceac258332 | |||
| da12dab7f0 | |||
| b580f52a16 | |||
| aa59abdc63 | |||
| 3bb3989d39 | |||
| 2ea5230362 | |||
|
|
022744ff0d | ||
|
|
76feada900 | ||
|
|
563b26b4c2 | ||
|
|
a64a75a550 | ||
|
|
6b95c42f3d | ||
|
|
267192615f | ||
|
|
139181de24 | ||
|
|
c304417d6c | ||
| 953cb4414b | |||
| 005efec7f6 | |||
| f434ee8946 | |||
|
|
d3d37c51c9 | ||
|
|
8c98d8cfd7 | ||
|
|
6e7f3533aa | ||
|
|
86ce07739a | ||
|
|
2d1d92d8a9 | ||
|
|
e09e7cf7a5 | ||
|
|
aa91648164 | ||
|
|
e4ac85922e | ||
|
|
629463b335 | ||
| 954340c183 | |||
|
|
86d29e0624 | ||
|
|
1b5e02d9b8 | ||
|
|
10c0d5b9e0 |
@@ -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
|
||||||
|
|||||||
2
.bashrc
2
.bashrc
@@ -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
|
||||||
|
|||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
nvim/.config/nvim/lua/*
|
||||||
@@ -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'
|
||||||
|
|||||||
32
git/.gitconfig
Normal file
32
git/.gitconfig
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# This is Git's per-user configuration file.
|
||||||
|
[user]
|
||||||
|
email = steven.proctor@gmail.com
|
||||||
|
name = Proctor
|
||||||
|
|
||||||
|
[core]
|
||||||
|
editor = nvim
|
||||||
|
excludesFile = ~/.gitignore.global
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
|
||||||
|
[alias] ; Command aliases for the git[1] command wrapper
|
||||||
|
last = cat-file commit HEAD
|
||||||
|
[branch]
|
||||||
|
autoSetupRebase = always
|
||||||
|
[checkout]
|
||||||
|
defaultRemote = origin
|
||||||
|
[merge]
|
||||||
|
ff = only
|
||||||
|
[push]
|
||||||
|
autoSetupRemote = true
|
||||||
|
default = upstream
|
||||||
|
[rerere]
|
||||||
|
enabled = true
|
||||||
|
[remote]
|
||||||
|
pushDefault = origin
|
||||||
|
|
||||||
|
;; This is last, take in any other local file overrides
|
||||||
|
[include]
|
||||||
|
path = ~/.gitconfig.local ; find ".gitconfig.local" in your `$HOME` directory
|
||||||
|
[pull]
|
||||||
|
ff = only
|
||||||
@@ -1,26 +1,24 @@
|
|||||||
(module dotfiles.conceal
|
(local u (require :dotfiles.util))
|
||||||
{autoload {nvim aniseed.nvim
|
|
||||||
nu aniseed.nvim.util
|
|
||||||
u dotfiles.util}})
|
|
||||||
|
|
||||||
|
(local conceals {:defn "𝑓"
|
||||||
(def conceals {:defn :𝑓
|
|
||||||
;; :defn- :
|
;; :defn- :
|
||||||
:fn :λ
|
:fn "λ"
|
||||||
:lambda :λ
|
:lambda "λ"
|
||||||
:and :∧
|
:and "∧"
|
||||||
:&& :∧
|
:&& "∧"
|
||||||
:or :∨
|
:or "∨"
|
||||||
:|| :∨
|
:|| "∨"
|
||||||
:not :¬
|
:not "¬"
|
||||||
:! :¬
|
:! "¬"
|
||||||
:for :∀
|
:for "∀"
|
||||||
:in :∈
|
:in "∈"
|
||||||
; "\\<not\\> \\<in\\>" :∉
|
; "\\<not\\> \\<in\\>" :∉
|
||||||
:true :⊤
|
:true "⊤"
|
||||||
:false :⊥
|
:false "⊥"
|
||||||
;; and
|
;; and
|
||||||
;; or
|
;; or
|
||||||
|
;; if-not
|
||||||
|
;; when-not
|
||||||
;; (not
|
;; (not
|
||||||
;; None | ∅
|
;; None | ∅
|
||||||
;; true, false | ⊤, ⊥ (top and bottom from logic)
|
;; true, false | ⊤, ⊥ (top and bottom from logic)
|
||||||
@@ -30,32 +28,31 @@
|
|||||||
;; not in | ∉
|
;; not in | ∉
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(fn setup-conceals []
|
||||||
(defn setup-conceals []
|
(vim.fn.clearmatches)
|
||||||
(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)
|
||||||
|
;(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>ct "call ToggleConceal()")
|
|
||||||
|
|
||||||
(def pretty-filetypes [:fennel
|
(each [_ ftype (pairs pretty-filetypes)]
|
||||||
:clojure])
|
(vim.api.nvim_create_autocmd [:FileType]
|
||||||
|
{:pattern ftype :callback setup-conceals}))
|
||||||
|
|
||||||
; (each [_ ftype (pairs pretty-filetypes)]
|
{}
|
||||||
; (nvim.ex.autocmd :FileType ftype :call "SetupConceals()"))
|
|
||||||
;
|
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
(module dotfiles.core
|
(module dotfiles.core
|
||||||
{autoload
|
{autoload {a aniseed.core}
|
||||||
{a aniseed.core}
|
require {anenv aniseed.env nvim aniseed.nvim}})
|
||||||
require
|
|
||||||
{anenv aniseed.env
|
|
||||||
nvim aniseed.nvim
|
|
||||||
nu aniseed.nvim.util
|
|
||||||
u dotfiles.util
|
|
||||||
}})
|
|
||||||
|
|
||||||
|
(local u (require :dotfiles.util))
|
||||||
|
|
||||||
(nvim.ex.set "shortmess+=c") ; don't give |ins-completion-menu| messages.
|
(nvim.ex.set :shortmess+=c)
|
||||||
(nvim.ex.set "path+=**")
|
|
||||||
|
; don't give |ins-completion-menu| messages.
|
||||||
|
(nvim.ex.set :path+=**)
|
||||||
(nvim.ex.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*")
|
(nvim.ex.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*")
|
||||||
|
|
||||||
(defn- safe-source
|
(defn- safe-source
|
||||||
@@ -19,25 +16,27 @@
|
|||||||
(if (not (a.empty? glob))
|
(if (not (a.empty? glob))
|
||||||
(nvim.ex.source filename))))
|
(nvim.ex.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))
|
||||||
|
(def- undo-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup))
|
||||||
|
|
||||||
(def- backup-dir (.. (nvim.fn.glob "$HOME") "/.vim/backup"))
|
(def- on-opts
|
||||||
(def- undo-dir (.. (nvim.fn.glob "$HOME") "/.vim/backup"))
|
[:autoindent
|
||||||
|
|
||||||
(def- on-opts [
|
|
||||||
:autoindent
|
|
||||||
:autoread
|
:autoread
|
||||||
:expandtab
|
:expandtab
|
||||||
:exrc ; allow project level (neo)vim files
|
:exrc
|
||||||
|
; allow project level (neo)vim files
|
||||||
:hlsearch
|
:hlsearch
|
||||||
:ignorecase
|
:ignorecase
|
||||||
:incsearch
|
:incsearch
|
||||||
:number
|
:number
|
||||||
:ruler
|
:ruler
|
||||||
:secure
|
:secure
|
||||||
:shiftround ; When at 3 spaces and I hit >>, go to 4, not 5.
|
:shiftround
|
||||||
:showcmd ; shows (parital) command in the status line
|
; When at 3 spaces and I hit >>, go to 4, not 5.
|
||||||
|
:showcmd
|
||||||
|
; shows (parital) command in the status line
|
||||||
:showmatch
|
:showmatch
|
||||||
:smartcase
|
:smartcase
|
||||||
:splitbelow
|
:splitbelow
|
||||||
@@ -45,77 +44,83 @@
|
|||||||
:termguicolors
|
:termguicolors
|
||||||
:title
|
:title
|
||||||
:undofile
|
:undofile
|
||||||
:wildmenu
|
:wildmenu])
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
(def- val-based-opts
|
(def- val-based-opts
|
||||||
{
|
{; :t_Co 256
|
||||||
; :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
|
||||||
:background "dark"
|
:guifontwide :Hasklig
|
||||||
|
:background :dark
|
||||||
:backupdir backup-dir
|
:backupdir backup-dir
|
||||||
:directory backup-dir ;Don't clutter my dirs up with swp and tmp files
|
:directory backup-dir
|
||||||
:grepprg "ag" ; Use Silver Searcher instead of grep
|
;Don't clutter my dirs up with swp and tmp files
|
||||||
:tags "tags"
|
:grepprg "ag --vimgrep"
|
||||||
:updatetime 300 ; per coc.vim for diagnostic messages
|
; Use Silver Searcher instead of grep
|
||||||
|
:tags :tags
|
||||||
|
:updatetime 300
|
||||||
|
; per coc.vim for diagnostic messages
|
||||||
:signcolumn "auto:1-3"
|
:signcolumn "auto:1-3"
|
||||||
:cmdheight 2 ; Better display for messages
|
:colorcolumn [81 100]
|
||||||
|
:cmdheight 2
|
||||||
|
; 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 ""
|
||||||
:list true
|
:list true
|
||||||
:listchars "tab:➥\\ ,trail:·"
|
:listchars "tab:➥\\ ,trail:·,nbsp:■"
|
||||||
:backspace "indent,eol,start" ;allow backspacing over everything in insert mode
|
:backspace "indent,eol,start"
|
||||||
|
;allow backspacing over everything in insert mode
|
||||||
:wildmode "list:longest,list:full"
|
:wildmode "list:longest,list:full"
|
||||||
:wrap false
|
:wrap false})
|
||||||
})
|
|
||||||
|
|
||||||
(defn- set-opt
|
(def- append-val-opts {:diffopt "algorithm:patience"})
|
||||||
|
|
||||||
|
(defn- set-opt [[opt val]] (tset vim.opt (a.str opt) val))
|
||||||
|
|
||||||
|
(defn- set-opt+
|
||||||
[[opt val]]
|
[[opt val]]
|
||||||
(tset vim.opt (a.str opt) val))
|
(let [existing-opt-val (a.get nvim.o opt)]
|
||||||
|
(tset vim.opt (a.str opt) (a.str existing-opt-val "," val))))
|
||||||
|
|
||||||
(defn- set-opt-on
|
(defn- set-opt-on [opt] (set-opt [opt true]))
|
||||||
[opt]
|
|
||||||
(set-opt [opt true]))
|
|
||||||
|
|
||||||
(a.map set-opt-on on-opts)
|
(a.map set-opt-on on-opts)
|
||||||
|
|
||||||
(a.map-indexed set-opt val-based-opts)
|
(a.map-indexed set-opt val-based-opts)
|
||||||
|
|
||||||
(nvim.ex.syntax "on")
|
(a.map-indexed set-opt+ append-val-opts)
|
||||||
(nvim.ex.colorscheme :soluarized)
|
|
||||||
|
|
||||||
|
(nvim.ex.syntax :on)
|
||||||
|
;; (nvim.ex.colorscheme :soluarized)
|
||||||
|
(nvim.ex.colorscheme :solarized8)
|
||||||
|
|
||||||
|
;; (nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "soluarized")
|
||||||
(nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "solarized8")
|
(nvim.ex.autocmd :vimenter "*" :++nested :colorscheme :solarized8)
|
||||||
;(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 []
|
||||||
[]
|
(vim.cmd "new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel"))
|
||||||
(nvim.command "new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel"))
|
|
||||||
|
(vim.api.nvim_create_user_command :FennelScratchBuffer make-fennel-scratch {})
|
||||||
|
|
||||||
(nu.fn-bridge :FennelScratchBuffer :dotfiles.core :make-fennel-scratch {:return false})
|
|
||||||
(u.nnoremap :<leader>fsb ":call FennelScratchBuffer ()<CR>")
|
(u.nnoremap :<leader>fsb ":call FennelScratchBuffer ()<CR>")
|
||||||
|
|
||||||
(defn compile-fnl []
|
(fn compile-fnl [] (print :recompiling)
|
||||||
(print :recompiling)
|
(anenv.init {:force true :init :dotfiles.init}))
|
||||||
(anenv.init
|
|
||||||
{:force true
|
|
||||||
:init :dotfiles.init}))
|
|
||||||
|
|
||||||
(nu.fn-bridge :AniseedCompile :dotfiles.core :compile-fnl {:return false})
|
(vim.api.nvim_create_user_command :AniseedCompile compile-fnl {})
|
||||||
|
|||||||
@@ -5,11 +5,12 @@
|
|||||||
{nvim aniseed.nvim}})
|
{nvim aniseed.nvim}})
|
||||||
|
|
||||||
|
|
||||||
(require :dotfiles.plugins)
|
|
||||||
(require :dotfiles.core)
|
(require :dotfiles.core)
|
||||||
|
(require :dotfiles.plugins)
|
||||||
(require :dotfiles.mapping)
|
(require :dotfiles.mapping)
|
||||||
(require :dotfiles.conceal)
|
(require :dotfiles.conceal)
|
||||||
(require :dotfiles.zoom-toggle)
|
(require :dotfiles.zoom-toggle)
|
||||||
|
|
||||||
;(nvim.ex.source "~/.vimrc")
|
;(nvim.ex.source "~/.vimrc")
|
||||||
|
|
||||||
|
(a.println "(re)loaded")
|
||||||
|
|||||||
@@ -1,39 +1,49 @@
|
|||||||
(module dotfiles.mapping
|
(module dotfiles.mapping
|
||||||
{autoload {nvim aniseed.nvim
|
{autoload {nvim aniseed.nvim
|
||||||
nu aniseed.nvim.util
|
nu aniseed.nvim.util
|
||||||
core aniseed.core}})
|
core aniseed.core
|
||||||
|
util dotfiles.util}})
|
||||||
|
|
||||||
(defn- noremap [mode from to]
|
(defn- noremap [mode from to] "Sets a mapping with {:noremap true}."
|
||||||
"Sets a mapping with {:noremap true}."
|
|
||||||
(nvim.set_keymap mode from to {:noremap true}))
|
(nvim.set_keymap mode from to {:noremap true}))
|
||||||
|
|
||||||
; (set nvim.g.mapleader "\\")
|
; (set nvim.g.mapleader "\\")
|
||||||
|
|
||||||
(noremap :n "<leader>`" ":source ~/.config/nvim/init.lua<CR>")
|
(defn aniseed-reload []
|
||||||
(noremap :n "<leader>!" ":call AniseedCompile()<CR>")
|
(each [k _ (ipairs package.loaded)]
|
||||||
|
(when (string.match k "^dotfiles%..+")
|
||||||
|
(tset package.loaded k nil)))
|
||||||
|
((. (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>! ":call AniseedCompile()<CR>")
|
||||||
|
|
||||||
(noremap :n :<Enter> ":nohlsearch<Enter>/<BS>")
|
(noremap :n :<Enter> ":nohlsearch<Enter>/<BS>")
|
||||||
|
|
||||||
;; Correct to first spelling suggestion.
|
;; Correct to first spelling suggestion.
|
||||||
(noremap :n :<leader>zz ":normal! 1z=<cr>")
|
(noremap :n :<leader>zz ":normal! 1z=<cr>")
|
||||||
|
|
||||||
|
|
||||||
;; nice paste from clipboard in insert mode
|
;; nice paste from clipboard in insert mode
|
||||||
(noremap :i :<C-V><C-O> ":set paste<CR><C-R><C-R>+<C-O>:set nopaste<CR>")
|
(noremap :i :<C-V><C-O> ":set paste<CR><C-R><C-R>+<C-O>:set nopaste<CR>")
|
||||||
|
|
||||||
|
|
||||||
; 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>
|
||||||
(noremap :v :<leader>ah "S<a href=\"\" target=\"_blank\" rel=\"nopener noreferrer\"><CR>")
|
(noremap :v :<leader>ah
|
||||||
|
"S<a href=\"\" target=\"_blank\" rel=\"nopener noreferrer\"><CR>")
|
||||||
|
|
||||||
(noremap :v :<leader>ml "xi[<c-r>\"]()<esc>")
|
(noremap :v :<leader>ml "xi[<c-r>\"]()<esc>")
|
||||||
|
|
||||||
|
(noremap :n :<C-e> :3<C-e>)
|
||||||
(noremap :n :<C-e> "3<C-e>")
|
(noremap :n :<C-y> :3<C-y>)
|
||||||
(noremap :n :<C-y> "3<C-y>")
|
|
||||||
|
|
||||||
; Unimpaired configuration
|
; Unimpaired configuration
|
||||||
; Bubble single lines
|
; Bubble single lines
|
||||||
@@ -54,8 +64,53 @@
|
|||||||
(noremap :n :gsh ":GitGutterStageHunk<CR>")
|
(noremap :n :gsh ":GitGutterStageHunk<CR>")
|
||||||
|
|
||||||
; Open file in Marked 2 (markdown viewer)
|
; Open file in Marked 2 (markdown viewer)
|
||||||
(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)
|
||||||
|
|
||||||
|
(noremap :n :Q ":.!bash <CR>")
|
||||||
|
|
||||||
|
; Ruby old hash syntax to new hash syntax
|
||||||
|
;(util/lvnoremap :uhs "<C-U>s/\\([a-z][^ \\t]*\\) =>/\\1:/ge" )
|
||||||
|
;(util/lnnoremap :uhs "<C-U>s/\\([a-z][^ \\t]*\\) =>/\\1:/ge" )
|
||||||
|
|
||||||
|
; Trim trailing Whitespace in visual selection
|
||||||
|
(util.lvnoremap :tw "<C-U>s/\\s\\+$//ge<CR>:nohlsearch<Enter>/<BS>")
|
||||||
|
|
||||||
|
; Trim trailing Whitespace in current line
|
||||||
|
(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
|
||||||
|
; ˙ -> alt-h
|
||||||
|
; ∆ -> alt-j
|
||||||
|
; ˚ -> alt-k
|
||||||
|
; ¬ -> alt-l
|
||||||
|
;; Terminal mode
|
||||||
|
;; (noremap :t "˙" "<c-\\><c-n><c-w>h")
|
||||||
|
;; (noremap :t "∆" "<c-\\><c-n><c-w>j")
|
||||||
|
;; (noremap :t "˚" "<c-\\><c-n><c-w>k")
|
||||||
|
;; (noremap :t "¬" "<c-\\><c-n><c-w>l")
|
||||||
|
;; ;; Insert mode:
|
||||||
|
;; (noremap :i "˙" :<Esc><c-w>h)
|
||||||
|
;; (noremap :i "∆" :<Esc><c-w>j)
|
||||||
|
;; (noremap :i "˚" :<Esc><c-w>k)
|
||||||
|
;; (noremap :i "¬" :<Esc><c-w>l)
|
||||||
|
;; ;; Visual mode:
|
||||||
|
;; (noremap :v "˙" :<Esc><c-w>h)
|
||||||
|
;; (noremap :v "∆" :<Esc><c-w>j)
|
||||||
|
;; (noremap :v "˚" :<Esc><c-w>k)
|
||||||
|
;; (noremap :v "¬" :<Esc><c-w>l)
|
||||||
|
;; ;; Normal mode:
|
||||||
|
;; (noremap :n "˙" :<c-w>h)
|
||||||
|
;; (noremap :n "∆" :<c-w>j)
|
||||||
|
;; (noremap :n "˚" :<c-w>k)
|
||||||
|
;; (noremap :n "¬" :<c-w>l)
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
(module dotfiles.plugin.cmp
|
(module dotfiles.plugin.cmp {autoload {nvim aniseed.nvim luasnip luasnip}})
|
||||||
{autoload {nvim aniseed.nvim}})
|
|
||||||
|
|
||||||
|
(module config.plugin.cmp {autoload {nvim aniseed.nvim cmp cmp}})
|
||||||
|
|
||||||
(module config.plugin.cmp
|
(def- cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp})
|
||||||
{autoload {nvim aniseed.nvim
|
|
||||||
cmp cmp}})
|
|
||||||
|
|
||||||
(def- cmp-src-menu-items
|
(def- cmp-srcs [{:name :nvim_lsp}
|
||||||
{:buffer "buff"
|
{:name :nvim_lua}
|
||||||
:conjure "conj"
|
{:name :luasnip}
|
||||||
:nvim_lsp "lsp"})
|
|
||||||
|
|
||||||
(def- cmp-srcs
|
|
||||||
[{:name :nvim_lsp}
|
|
||||||
{:name :vsnip}
|
{:name :vsnip}
|
||||||
{:name :conjure}
|
{:name :conjure}
|
||||||
{:name :buffer}])
|
{:name :buffer}
|
||||||
|
{: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)]
|
||||||
(cmp.setup {:formatting
|
(cmp.setup {:formatting {:format (fn [entry item]
|
||||||
{:format (fn [entry item]
|
(set item.menu
|
||||||
(set item.menu (or (. cmp-src-menu-items entry.source.name) ""))
|
(or (. cmp-src-menu-items
|
||||||
|
entry.source.name)
|
||||||
|
""))
|
||||||
item)}
|
item)}
|
||||||
:mapping {:<C-p> (cmp.mapping.select_prev_item)
|
:mapping {:<C-p> (cmp.mapping.select_prev_item)
|
||||||
:<C-n> (cmp.mapping.select_next_item)
|
:<C-n> (cmp.mapping.select_next_item)
|
||||||
@@ -29,14 +27,13 @@
|
|||||||
:<C-f> (cmp.mapping.scroll_docs 4)
|
:<C-f> (cmp.mapping.scroll_docs 4)
|
||||||
:<C-Space> (cmp.mapping.complete)
|
:<C-Space> (cmp.mapping.complete)
|
||||||
:<C-e> (cmp.mapping.close)
|
:<C-e> (cmp.mapping.close)
|
||||||
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert
|
:<C-y> (cmp.mapping.confirm {;; :behavior cmp.ConfirmBehavior.Insert
|
||||||
:select true})}
|
:select true})}
|
||||||
|
|
||||||
:snippet {:expand (fn [args]
|
:snippet {:expand (fn [args]
|
||||||
(nvim.fn.vsnip#anonymous args.body))}
|
(if args
|
||||||
|
(luasnip.lsp_expand args.body)))}
|
||||||
:sources cmp-srcs}))
|
:sources cmp-srcs}))
|
||||||
|
|
||||||
|
|
||||||
;;; imap <expr> <C-j> vsnip#available(1) ? '<Plug>(vsnip-expand)' : '<C-j>'
|
;;; imap <expr> <C-j> vsnip#available(1) ? '<Plug>(vsnip-expand)' : '<C-j>'
|
||||||
;;; imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
;;; imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
||||||
;;; smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
;;; smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
(module dotfiles.plugin.colorizer
|
(module dotfiles.plugin.colorizer
|
||||||
{autoload {colorizer colorizer}})
|
{autoload {colorizer colorizer}})
|
||||||
|
|
||||||
(colorizer.setup {"*" {}}
|
(colorizer.setup [:*]
|
||||||
{:RGB true ; #RGB hex codes, like #F00
|
{:RGB true ; #RGB hex codes, like #F00
|
||||||
:RRGGBB true ; #RRGGBB hex codes, like #00FF00
|
:RRGGBB true ; #RRGGBB hex codes, like #00FF00
|
||||||
:names true ; "Name" codes like Blue
|
:names true ; "Name" codes like Blue
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
:nvim_lsp true
|
:nvim_lsp true
|
||||||
:nvim_lua true
|
:nvim_lua true
|
||||||
:conjure true
|
:conjure true
|
||||||
|
:orgmode true
|
||||||
:vsnip true
|
:vsnip true
|
||||||
:vim_dadbod_completion true}})))
|
:vim_dadbod_completion true}})))
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
; (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 nvim.g.conjure#mapping#doc_word "gk")
|
||||||
|
(set nvim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC)
|
||||||
(set nvim.g.conjure#extract#tree_sitter#enabled true)
|
(set nvim.g.conjure#extract#tree_sitter#enabled true)
|
||||||
|
|
||||||
(conjure-config.assoc-in [:filetypes] (a.concat (conjure-config.filetypes) [:markdown] ))
|
(conjure-config.assoc-in [:filetypes] (a.concat (conjure-config.filetypes) [:markdown] ))
|
||||||
|
|||||||
10
nvim/.config/nvim/fnl/dotfiles/plugin/fugitive.fnl
Normal file
10
nvim/.config/nvim/fnl/dotfiles/plugin/fugitive.fnl
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
(module dotfiles.plugin.fugitive
|
||||||
|
{autoload {nvim aniseed.nvim
|
||||||
|
nu aniseed.nvim.util
|
||||||
|
core aniseed.core
|
||||||
|
util dotfiles.util}})
|
||||||
|
|
||||||
|
;; Determine load time of fugitive
|
||||||
|
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gp ":Git pull<CR>")
|
||||||
|
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gP ":Git push<CR>" )
|
||||||
|
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gF ":Git push -f<CR>" )
|
||||||
2
nvim/.config/nvim/fnl/dotfiles/plugin/headlines.fnl
Normal file
2
nvim/.config/nvim/fnl/dotfiles/plugin/headlines.fnl
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
(module dotfiles.plugin.headlines
|
||||||
|
{autoload {headlines headlines}})
|
||||||
3
nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl
Normal file
3
nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
(module dotfiles.plugin.hex {autoload {nvim aniseed.nvim hex hex}})
|
||||||
|
|
||||||
|
(hex.setup)
|
||||||
@@ -1,84 +1,109 @@
|
|||||||
(module dotfiles.plugin.lspconfig
|
(module dotfiles.plugin.lspconfig
|
||||||
{autoload
|
{autoload {a aniseed.core
|
||||||
{a aniseed.core
|
|
||||||
u dotfiles.util
|
u dotfiles.util
|
||||||
nvim aniseed.nvim
|
nvim aniseed.nvim
|
||||||
nu aniseed.nvim.util
|
lsp vim.lsp
|
||||||
}
|
lspconfig lspconfig
|
||||||
})
|
mason dotfiles.plugin.mason
|
||||||
|
cmp_nvim_lsp cmp_nvim_lsp}})
|
||||||
|
|
||||||
(defn bufmap [mode from to]
|
(defn bufmap [mode from to] (u.noremap mode from to {:local? true}))
|
||||||
(u.noremap mode from to {:local? true}))
|
|
||||||
|
|
||||||
(defn nbufmap [from to]
|
(defn nbufmap [from to] (bufmap :n from to))
|
||||||
(bufmap :n from to))
|
|
||||||
|
|
||||||
(defn xbufmap [from to]
|
(defn xbufmap [from to] (bufmap :x from to))
|
||||||
(bufmap :x from to))
|
|
||||||
|
|
||||||
|
(vim.diagnostic.config {:signs {:text {vim.diagnostic.severity.ERROR "☢️"
|
||||||
(defn define-sign [level sign]
|
vim.diagnostic.severity.WARN "⚠️"
|
||||||
(let [sign-level (.. "DiagnosticSign" level)]
|
vim.diagnostic.severity.INFO "ℹ️"
|
||||||
(nvim.fn.sign_define sign-level
|
vim.diagnostic.severity.HINT "🔎"}
|
||||||
{:texthl sign-level
|
;; :linehl {vim.diagnostic.severity.ERROR :ErrorMsg}
|
||||||
:text sign
|
;; :numhl {vim.diagnostic.severity.WARN :WarningMsg}
|
||||||
:numhl sign-level})))
|
}})
|
||||||
|
|
||||||
; (define-sign :Error "☢️")
|
|
||||||
; (define-sign :Warn "⚠️")
|
|
||||||
; (define-sign :SignHint "🔎")
|
|
||||||
; (define-sign :Info "ℹ️")
|
|
||||||
(define-sign :Error "X")
|
|
||||||
(define-sign :Warn "!")
|
|
||||||
(define-sign :SignHint "?")
|
|
||||||
(define-sign :Info "i")
|
|
||||||
|
|
||||||
(def core-nmappings
|
(def 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()"
|
||||||
:<leader>oc "lua vim.lsp.buf.outgoing_calls()"
|
;; TODO: think of new mapping; conficts with org mode
|
||||||
|
;; :<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.formatting_sync()"
|
:<leader>fa "lua vim.lsp.buf.format()"})
|
||||||
})
|
|
||||||
|
|
||||||
(def client-nmappings
|
(def client-nmappings
|
||||||
{:clojure_lsp
|
{:clojure_lsp {:<leader>cn "call LspExecuteCommand('clean-ns')"
|
||||||
{
|
|
||||||
:<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
|
||||||
|
{: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 []]}})
|
||||||
|
|
||||||
(defn bind-client-mappings [client]
|
(def server-specific-opts {})
|
||||||
|
|
||||||
|
(defn bind-client-mappings
|
||||||
|
[client]
|
||||||
(let [client-name (a.get client :name)
|
(let [client-name (a.get client :name)
|
||||||
mappings (a.get client-nmappings client-name)]
|
mappings (a.get client-nmappings client-name)
|
||||||
|
command-lnmappings (a.get client-command-lnmappings client-name)]
|
||||||
(when mappings
|
(when mappings
|
||||||
(each [mapping cmd (pairs mappings)]
|
(each [mapping cmd (pairs mappings)]
|
||||||
(nbufmap mapping cmd)))))
|
(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]
|
(defn on_attach
|
||||||
|
[client bufnr]
|
||||||
(each [mapping cmd (pairs core-nmappings)]
|
(each [mapping cmd (pairs core-nmappings)]
|
||||||
(nbufmap mapping cmd))
|
(nbufmap mapping cmd)) ; x mode mappings
|
||||||
|
(xbufmap :<leader>fa "lua vim.lsp.buf.format()") ; -- buf_set_keymap('n', 'gs', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>', opts)
|
||||||
; x mode mappings
|
|
||||||
(xbufmap :<leader>fa "lua vim.lsp.buf.formatting_sync()")
|
|
||||||
|
|
||||||
; -- 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', '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', '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>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||||
@@ -87,109 +112,39 @@
|
|||||||
; -- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<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('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)
|
; -- buf_set_keymap('x', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts)
|
||||||
|
|
||||||
(nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc")
|
(nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc")
|
||||||
|
|
||||||
(bind-client-mappings client)
|
(bind-client-mappings client)
|
||||||
(nvim.ex.autocmd :BufWritePre :<buffer> :lua "vim.lsp.buf.formatting_sync()")
|
(if client.server_capabilities.documentFormattingProvider
|
||||||
; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" :<buffer> :lua "vim.lsp.codelens.refresh()")
|
(nvim.ex.autocmd :BufWritePre :<buffer> ":lua vim.lsp.buf.format()")) ; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" :<buffer> :lua "vim.lsp.codelens.refresh()")
|
||||||
|
; client autocmds ; -- 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'})]]
|
||||||
; client autocmds
|
|
||||||
; -- 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'})]]
|
|
||||||
|
|
||||||
(print "LSP Client Attached."))
|
(print "LSP Client Attached."))
|
||||||
|
|
||||||
(let [lspi (require :nvim-lsp-installer)]
|
(def base-server-opts
|
||||||
(when lspi
|
(let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))]
|
||||||
|
{: on_attach : capabilities :flags {:debounce_text_changes 150}}))
|
||||||
|
|
||||||
(defn lsp-execute-command [cmd ...]
|
(defn default-server-handler
|
||||||
|
[server-name]
|
||||||
|
(let [specific-opts (a.get server-specific-opts server-name {})
|
||||||
|
server (a.get lspconfig server-name)
|
||||||
|
server-opts (a.merge base-server-opts server-opts)]
|
||||||
|
(server.setup server-opts)))
|
||||||
|
|
||||||
|
(defn lsp-execute-command
|
||||||
|
[cmd ...]
|
||||||
(let [buf-uri (vim.uri_from_bufnr 0)
|
(let [buf-uri (vim.uri_from_bufnr 0)
|
||||||
cursor (vim.api.nvim_win_get_cursor 0)
|
cursor (vim.api.nvim_win_get_cursor 0)
|
||||||
r (- (a.first cursor) 1)
|
r (- (a.first cursor) 1)
|
||||||
c (a.second cursor)
|
c (a.second cursor)
|
||||||
opts [buf-uri r c]
|
opts [buf-uri r c]
|
||||||
args (a.concat opts [...])]
|
args (a.concat opts [...])]
|
||||||
(vim.lsp.buf.execute_command {:command cmd
|
(vim.lsp.buf.execute_command {:command cmd :arguments args})))
|
||||||
:arguments args})))
|
|
||||||
|
|
||||||
(defn setup-servers []
|
(mason.setup)
|
||||||
(lspi.on_server_ready (fn [server]
|
|
||||||
(let [opts {:on_attach on_attach :flags {:debounce_text_changes 150} }]
|
|
||||||
(server:setup opts))))
|
|
||||||
;; (let [lspconfig (require :lspconfig)
|
|
||||||
;; servers (lspi.get_installed_servers)]
|
|
||||||
;; (each [_ server (pairs servers)]
|
|
||||||
;; (server.setup {:on_attach on_attach :flags {:debounce_text_changes 150} })))
|
|
||||||
)
|
|
||||||
|
|
||||||
(defn on-post-install []
|
(when-let [mason-lspconfig (require :mason-lspconfig)] (mason-lspconfig.setup)
|
||||||
(setup-servers)
|
(mason-lspconfig.setup_handlers {1 default-server-handler}))
|
||||||
(nvim.ex.bufdo :e))
|
|
||||||
|
|
||||||
(setup-servers)
|
(u.nnoremap :<leader>li :LspInfo)
|
||||||
|
|
||||||
(set lspi.post_install_hook on-post-install)
|
(vim.api.nvim_create_user_command :LspExecuteCommand lsp-execute-command {})
|
||||||
(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig :lsp-execute-command {:return false})
|
|
||||||
|
|
||||||
(u.nnoremap :<leader>li "LspInfo")))
|
|
||||||
|
|
||||||
|
|
||||||
;; (let [eval (require :conjure.eval)
|
|
||||||
;; client (require :conjure.client)
|
|
||||||
;; ts-utils (require :nvim-treesitter.ts_utils)
|
|
||||||
;; parsers (require :nvim-treesitter.parsers)
|
|
||||||
;; ]
|
|
||||||
;;
|
|
||||||
;; ; client["with-filetype"]("fennel", eval["eval-str"], {
|
|
||||||
;; ; origin = "my-awesome-plugin",
|
|
||||||
;; ; code = "(+ 10 20)",
|
|
||||||
;; ; ["passive?"] = true,
|
|
||||||
;; ; ["on-result"] = function (r)
|
|
||||||
;; ; print("RESULT:", r)
|
|
||||||
;; ; end
|
|
||||||
;; ; })
|
|
||||||
;;
|
|
||||||
;; (defn ts-node-descendent-of? [node ancestor-type]
|
|
||||||
;; (print node)
|
|
||||||
;; (if (= nil node)
|
|
||||||
;; false
|
|
||||||
;; (let [node-type (node:type)]
|
|
||||||
;; (print node-type)
|
|
||||||
;; (if (= ancestor-type node-type)
|
|
||||||
;; true
|
|
||||||
;; (ts-node-descendent-of? (node:parent) ancestor-type)))))
|
|
||||||
;;
|
|
||||||
;; (defn in-fenced-code-block? []
|
|
||||||
;; (let [cursor (vim.api.nvim_win_get_cursor 0)
|
|
||||||
;; lnum (a.first cursor)
|
|
||||||
;; col (a.second cursor)
|
|
||||||
;; root_lang_tree (parsers.get_parser)
|
|
||||||
;; range [ lnum - 1 col lnum - 1 col ]
|
|
||||||
;; (node root lang-tree) (ts-utils.get_root_for_position (- lnum 1) col root_lang_tree) ]
|
|
||||||
;; (a.pr "language" (a.get lang-tree :_lang :err))
|
|
||||||
;; )
|
|
||||||
;; (let [node-at-cursor (ts-utils.get_node_at_cursor)]
|
|
||||||
;; (print "node at cursor" node-at-cursor)
|
|
||||||
;; (a.pr "root for node at cursor " (ts-utils.get_root_for_node node-at-cursor))
|
|
||||||
;; (print (ts-node-descendent-of? node-at-cursor :fenced_code_block))))
|
|
||||||
;;
|
|
||||||
;; (defn markdown-code-to-repl []
|
|
||||||
;; ; (let [buf-uri (vim.uri_from_bufnr 0)
|
|
||||||
;; ; cursor (vim.api.nvim_win_get_cursor 0)
|
|
||||||
;; ; r (- (a.first cursor) 1)
|
|
||||||
;; ; c (a.second cursor)
|
|
||||||
;; ; opts [buf-uri r c]
|
|
||||||
;; ; args (a.concat opts [...])]
|
|
||||||
;; ; (vim.lsp.buf.execute_command {:command cmd
|
|
||||||
;; ; :arguments args}))
|
|
||||||
;; )
|
|
||||||
;;
|
|
||||||
;; (nu.fn-bridge :MarkdownCodeToRepl :dotfiles.plugin.lspconfig :markdown-code-to-repl {:return false})
|
|
||||||
;;
|
|
||||||
;; (nu.fn-bridge :IsInFencedCodeBlock :dotfiles.plugin.lspconfig :in-fenced-code-block? {:return false})
|
|
||||||
;;
|
|
||||||
;; ;; If file type is Markdown
|
|
||||||
;; ;(u.nnoremap :<leader>ee "call MarkdownCodeToRepl")
|
|
||||||
;;
|
|
||||||
;; )
|
|
||||||
;;
|
|
||||||
|
|||||||
19
nvim/.config/nvim/fnl/dotfiles/plugin/luasnip.fnl
Normal file
19
nvim/.config/nvim/fnl/dotfiles/plugin/luasnip.fnl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
(module dotfiles.plugin.luasnip
|
||||||
|
{autoload {nvim aniseed.nvim util dotfiles.util luasnip luasnip}
|
||||||
|
require {select_choice luasnip.extras.select_choice}})
|
||||||
|
|
||||||
|
(vim.keymap.set [:i :s] :<C-k>
|
||||||
|
(fn []
|
||||||
|
(if (luasnip.expand_or_jumpable)
|
||||||
|
(luasnip.expand_or_jump))) {:silent true})
|
||||||
|
|
||||||
|
(vim.keymap.set [:i :s] :<C-j>
|
||||||
|
(fn []
|
||||||
|
(if (luasnip.jumpable -1)
|
||||||
|
(luasnip.jump -1))) {:silent true})
|
||||||
|
|
||||||
|
(vim.keymap.set :i :<C-l> (fn []
|
||||||
|
(if (luasnip.choice_active)
|
||||||
|
(luasnip.choice 1))))
|
||||||
|
|
||||||
|
(vim.keymap.set :i :<C-u> select_choice)
|
||||||
10
nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl
Normal file
10
nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
(module dotfiles.plugin.mason
|
||||||
|
{autoload {a aniseed.core
|
||||||
|
nvim aniseed.nvim mason mason mason-lspconf mason-lspconfig}})
|
||||||
|
|
||||||
|
(defn setup []
|
||||||
|
(when mason
|
||||||
|
(mason.setup {:ui {:icons {:package_installed "✓"}}})
|
||||||
|
(when mason-lspconf
|
||||||
|
(mason-lspconf.setup {:ensure_installed [:lua_ls]})
|
||||||
|
(mason-lspconf.setup_handlers {1 default-server-handler}))))
|
||||||
13
nvim/.config/nvim/fnl/dotfiles/plugin/null-ls.fnl
Normal file
13
nvim/.config/nvim/fnl/dotfiles/plugin/null-ls.fnl
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
(module dotfiles.plugin.null-ls
|
||||||
|
{autoload {nvim aniseed.nvim
|
||||||
|
a aniseed.core
|
||||||
|
nu aniseed.nvim.util
|
||||||
|
null-ls null-ls
|
||||||
|
lspconfig dotfiles.plugin.lspconfig}})
|
||||||
|
|
||||||
|
(def 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)
|
||||||
47
nvim/.config/nvim/fnl/dotfiles/plugin/orgbullets.fnl
Normal file
47
nvim/.config/nvim/fnl/dotfiles/plugin/orgbullets.fnl
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
(module dotfiles.plugin.orgbullets
|
||||||
|
{autoload {nvim aniseed.nvim a aniseed.core ts-utils dotfiles.ts-utils}})
|
||||||
|
|
||||||
|
(def stars ["◉" "⦾" "○" "✸" "✿" "✶" "•" "‣"])
|
||||||
|
|
||||||
|
(def stars-query "(headline (stars) @stars)")
|
||||||
|
|
||||||
|
(defn star-index [heading-level]
|
||||||
|
(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))
|
||||||
|
|
||||||
|
(def star-captures (ts-utils.make-query :org stars-query))
|
||||||
|
|
||||||
|
(defn gen-star-extmarks []
|
||||||
|
(when (= :org vim.bo.filetype)
|
||||||
|
(let [bufnr (vim.api.nvim_get_current_buf)
|
||||||
|
star-count (a.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 (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}))
|
||||||
11
nvim/.config/nvim/fnl/dotfiles/plugin/orgmode.fnl
Normal file
11
nvim/.config/nvim/fnl/dotfiles/plugin/orgmode.fnl
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
(module dotfiles.plugin.orgmode {autoload {orgmode orgmode}})
|
||||||
|
|
||||||
|
;;(orgmode.setup_ts_grammar)
|
||||||
|
|
||||||
|
(orgmode.setup {:org_agenda_files ["~/Dropbox/org/*" "~/my-orgs/**/*"]
|
||||||
|
:org_default_notes_file "~/Dropbox/org/refile.org"
|
||||||
|
:mappings {
|
||||||
|
:org {
|
||||||
|
:org_toggle_checkbox :<C-.>}}})
|
||||||
|
|
||||||
|
(require :dotfiles.plugin.orgbullets)
|
||||||
94
nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl
Normal file
94
nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
(module dotfiles.plugin.paredit
|
||||||
|
{autoload {nvim aniseed.nvim
|
||||||
|
a aniseed.core
|
||||||
|
nu aniseed.nvim.util
|
||||||
|
paredit paredit
|
||||||
|
ts-parsers nvim-treesitter.parsers
|
||||||
|
ts-utils nvim-treesitter.ts_utils
|
||||||
|
languagetree vim.treesitter.languagetree}})
|
||||||
|
|
||||||
|
(set nvim.g.paredit_smartjump 1)
|
||||||
|
|
||||||
|
(defn list-member? [xs x] (a.some #(= x $1) (a.vals xs)))
|
||||||
|
|
||||||
|
(defn bool->int [bool] (if bool 1 0))
|
||||||
|
|
||||||
|
(defn int->bool [x] (if (= 0 x) false true))
|
||||||
|
|
||||||
|
(defn toggle-global! [x] (->> (a.get nvim.g x)
|
||||||
|
(int->bool)
|
||||||
|
(not)
|
||||||
|
(bool->int)
|
||||||
|
(tset nvim.g x)))
|
||||||
|
|
||||||
|
(defn language-at-cursor [] (let [parser (ts-parsers.get_parser)
|
||||||
|
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))))
|
||||||
|
|
||||||
|
(defn parser-language [] (let [parser (ts-parsers.get_parser)]
|
||||||
|
(when parser
|
||||||
|
(parser:lang))))
|
||||||
|
|
||||||
|
(def- paredit-langs [:clojure
|
||||||
|
:fennel
|
||||||
|
:hy
|
||||||
|
:janet
|
||||||
|
:julia
|
||||||
|
:lfe
|
||||||
|
:lisp
|
||||||
|
:racket
|
||||||
|
:scheme
|
||||||
|
:shen])
|
||||||
|
|
||||||
|
(def- paredit-host-langs [:org :markdown :asciidoc])
|
||||||
|
|
||||||
|
(defn- host-lang-in? [langs] (list-member? langs (parser-language)))
|
||||||
|
|
||||||
|
(defn paredit-lang? [lang] (list-member? paredit-langs lang))
|
||||||
|
|
||||||
|
(defn TreeSitterLangParedit []
|
||||||
|
(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.ex.autocmd :FileType :ruby :call "PareditInitBalancingAllBracketsBuffer()")
|
||||||
|
(nvim.ex.autocmd :FileType :javascript :call "PareditInitBalancingAllBracketsBuffer()")
|
||||||
|
(nvim.ex.autocmd :FileType :terraform :call "PareditInitBalancingAllBracketsBuffer()")
|
||||||
|
|
||||||
|
; (nvim.del_augroup_by_name "BabeliteParedit")
|
||||||
|
; (nvim.get_autocmds {:group "BabeliteParedit"})
|
||||||
|
|
||||||
|
;;(let [group (nvim.create_augroup :BabeliteParedit {:clear true})]
|
||||||
|
;; (nvim.create_autocmd [:CursorHold :CursorMoved]
|
||||||
|
;; {: group
|
||||||
|
;; ;:pattern ["*.org" "*.md"]
|
||||||
|
;; :callback TreeSitterLangParedit}))
|
||||||
|
;;
|
||||||
|
|
||||||
|
;; (defn paredit-toggle! [] (toggle-global :paredit_mode)
|
||||||
|
;; (nvim.fn.PareditInitBuffer)
|
||||||
|
;; nvim.g.paredit_mode
|
||||||
|
;; )
|
||||||
|
;;
|
||||||
|
;; \
|
||||||
|
;; (int->bool 0)
|
||||||
|
;; (defn test [x] (a.get nvim.g x))
|
||||||
|
;;
|
||||||
|
;; (test :pareditmode)
|
||||||
|
;; (a.get nvim.g :paredit_mode)
|
||||||
|
;; (comment ;
|
||||||
|
;; nvim.g.paredit_mode
|
||||||
|
;; ;
|
||||||
|
;;
|
||||||
|
;; (paredit-toggle!)
|
||||||
|
;; )
|
||||||
27
nvim/.config/nvim/fnl/dotfiles/plugin/smartsplits.fnl
Normal file
27
nvim/.config/nvim/fnl/dotfiles/plugin/smartsplits.fnl
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
(module dotfiles.plugin.smartsplits
|
||||||
|
{autoload {nvim aniseed.nvim
|
||||||
|
a aniseed.core
|
||||||
|
smart-splits smart-splits
|
||||||
|
;; util dotfiles.util
|
||||||
|
}})
|
||||||
|
|
||||||
|
(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)
|
||||||
@@ -1,33 +1,48 @@
|
|||||||
(module dotfiles.plugin.telescope
|
(module dotfiles.plugin.telescope
|
||||||
{autoload {nvim aniseed.nvim
|
{autoload {nvim aniseed.nvim
|
||||||
util dotfiles.util
|
util dotfiles.util
|
||||||
telescope telescope}})
|
telescope telescope
|
||||||
|
project-nvim project_nvim}})
|
||||||
|
|
||||||
(telescope.setup
|
(def vimgrep_arguments [:ag
|
||||||
{:defaults
|
:--nocolor
|
||||||
{:vimgrep_arguments ["ag" "--nocolor" "--noheading"
|
:--noheading
|
||||||
"--number" "--column" "--nobreak"
|
:--number
|
||||||
"--smart-case" "--hidden" "--follow" ; "--skip-vcs-ignores"
|
:--column
|
||||||
|
:--nobreak
|
||||||
|
:--smart-case
|
||||||
|
:--hidden
|
||||||
|
; "--skip-vcs-ignores"
|
||||||
; "-g" "!.git/"
|
; "-g" "!.git/"
|
||||||
]}})
|
:--ignore
|
||||||
|
:.git
|
||||||
|
:--follow])
|
||||||
|
|
||||||
|
(telescope.load_extension :projects)
|
||||||
|
(telescope.load_extension :yank_history)
|
||||||
|
|
||||||
|
(telescope.setup {;; :defaults {: vimgrep_arguments}
|
||||||
|
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}
|
||||||
|
:extensions {:projects {:projects {}}}})
|
||||||
|
|
||||||
(util.lnnoremap :ff "Telescope git_files hidden=true")
|
|
||||||
(util.lnnoremap :f- "Telescope file_browser")
|
|
||||||
(util.lnnoremap :fg "Telescope live_grep")
|
|
||||||
(util.lnnoremap :* "Telescope grep_string")
|
|
||||||
(util.lnnoremap :fb "Telescope buffers")
|
|
||||||
(util.lnnoremap :fH "Telescope help_tags")
|
|
||||||
(util.lnnoremap :fm "Telescope keymaps")
|
|
||||||
(util.lnnoremap :fM "Telescope marks")
|
|
||||||
(util.lnnoremap :fh "Telescope oldfiles")
|
|
||||||
(util.lnnoremap :ft "Telescope filetypes")
|
|
||||||
(util.lnnoremap :fc "Telescope commands")
|
(util.lnnoremap :fc "Telescope commands")
|
||||||
(util.lnnoremap :fC "Telescope command_history")
|
(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 :fq "Telescope quickfix")
|
||||||
(util.lnnoremap :fl "Telescope loclist")
|
(util.lnnoremap :fl "Telescope loclist")
|
||||||
(util.lnnoremap :fsa "Telescope lsp_code_actions")
|
|
||||||
(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")
|
||||||
|
|||||||
27
nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl
Normal file
27
nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl
Normal 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})
|
||||||
@@ -1,22 +1,31 @@
|
|||||||
(module dotfiles.plugin.treesitter
|
(local treesitter-configs (require :nvim-treesitter.configs))
|
||||||
{autoload {treesitter nvim-treesitter.configs}})
|
|
||||||
|
|
||||||
(treesitter.setup
|
|
||||||
{:highlight {:enable true
|
|
||||||
:additional_vim_regex_highlighting false}
|
|
||||||
|
|
||||||
|
(treesitter-configs.setup {:highlight {:enable true
|
||||||
|
;; :additional_vim_regex_highlighting false
|
||||||
|
:additional_vim_regex_highlighting [:org]}
|
||||||
|
:ensure_installed :all
|
||||||
|
; [:org]
|
||||||
:rainbow {:enable true
|
:rainbow {:enable true
|
||||||
:extended_mode true ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
:extended_mode true
|
||||||
:max_file_lines 10000 ; Do not enable for files with more than 1000 lines, int
|
; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||||
:colors [
|
:max_file_lines 10000
|
||||||
:#dc322f ; red
|
; Do not enable for files with more than 1000 lines, int
|
||||||
:#b58900 ; yellow
|
:colors ["#dc322f"
|
||||||
:#d33682 ; magenta
|
; red
|
||||||
:#859900 ; green
|
"#b58900"
|
||||||
:#2aa198 ; cyan
|
; yellow
|
||||||
:#268bd2 ; blue
|
"#d33682"
|
||||||
:#6c71c4 ; violet / brmagenta
|
; magenta
|
||||||
] ; table of hex strings
|
"#859900"
|
||||||
}
|
; green
|
||||||
:playground {:enable true}
|
"#2aa198"
|
||||||
})
|
; 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())
|
||||||
|
|||||||
5
nvim/.config/nvim/fnl/dotfiles/plugin/whichkey.fnl
Normal file
5
nvim/.config/nvim/fnl/dotfiles/plugin/whichkey.fnl
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
(module dotfiles.plugin.whichkey
|
||||||
|
{autoload {which-key which-key}})
|
||||||
|
|
||||||
|
(which-key.setup {})
|
||||||
|
|
||||||
37
nvim/.config/nvim/fnl/dotfiles/plugin/yanky.fnl
Normal file
37
nvim/.config/nvim/fnl/dotfiles/plugin/yanky.fnl
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
(module dotfiles.plugin.yanky {autoload {nvim aniseed.nvim
|
||||||
|
a aniseed.core
|
||||||
|
;; util dotfiles.util
|
||||||
|
yanky yanky}
|
||||||
|
;; require {minpac minpac}
|
||||||
|
})
|
||||||
|
|
||||||
|
(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)")
|
||||||
@@ -1,88 +1,107 @@
|
|||||||
(module dotfiles.plugins
|
(module dotfiles.plugins {autoload {nvim aniseed.nvim
|
||||||
{autoload {nvim aniseed.nvim
|
|
||||||
a aniseed.core
|
a aniseed.core
|
||||||
;; util dotfiles.util
|
;; util dotfiles.util
|
||||||
packer packer
|
packer packer}
|
||||||
|
|
||||||
}
|
|
||||||
;; require {minpac minpac}
|
;; require {minpac minpac}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
(defn safe-require-plugin-config [name]
|
(defn 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]
|
(defn- use [pkgs] "Iterates through the arguments as pairs and calls packer's use function for
|
||||||
"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
|
(packer.startup (fn [use]
|
||||||
(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 (a.assoc opts 1 name))))))
|
||||||
))))
|
|
||||||
|
|
||||||
|
(def- packages {:Olical/aniseed {}
|
||||||
(def- packages
|
:Olical/conjure {:mod :conjure}
|
||||||
{
|
:Olical/fennel.vim {}
|
||||||
:Olical/aniseed {}
|
:ahmedkhalf/project.nvim {}
|
||||||
:Olical/conjure { :mod :conjure } ; Clojure
|
:airblade/vim-gitgutter {}
|
||||||
:Olical/fennel.vim {} ; Fennel
|
:akinsho/toggleterm.nvim {:mod :toggleterm}
|
||||||
:airblade/vim-gitgutter {} ; Git
|
:clojure-vim/vim-jack-in {}
|
||||||
:airblade/vim-gitgutter {} ; Git
|
:christianrondeau/vim-base64 {}
|
||||||
:clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies
|
:dhruvasagar/vim-table-mode {}
|
||||||
:folke/lsp-colors.nvim {}
|
:folke/lsp-colors.nvim {}
|
||||||
:hashivim/vim-terraform {} ; Terraform
|
: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/nvim-cmp {:requires [:hrsh7th/cmp-buffer
|
||||||
|
:hrsh7th/cmp-emoji
|
||||||
:hrsh7th/cmp-nvim-lsp
|
:hrsh7th/cmp-nvim-lsp
|
||||||
|
:hrsh7th/cmp-nvim-lua
|
||||||
|
:hrsh7th/cmp-path
|
||||||
:hrsh7th/cmp-vsnip
|
:hrsh7th/cmp-vsnip
|
||||||
:hrsh7th/vim-vsnip-integ
|
:hrsh7th/vim-vsnip-integ
|
||||||
:PaterJason/cmp-conjure]
|
:L3MON4D3/LuaSnip
|
||||||
:mod :cmp} ; autocomplete
|
:PaterJason/cmp-conjure
|
||||||
|
:saadparwaiz1/cmp_luasnip]
|
||||||
|
:mod :cmp}
|
||||||
:hrsh7th/vim-vsnip {}
|
:hrsh7th/vim-vsnip {}
|
||||||
:hrsh7th/vim-vsnip-integ {}
|
:hrsh7th/vim-vsnip-integ {}
|
||||||
:Iron-E/nvim-soluarized {}
|
:Iron-E/nvim-soluarized {}
|
||||||
:jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs
|
:jiangmiao/auto-pairs {}
|
||||||
|
:nvimtools/none-ls.nvim {:mod :null-ls
|
||||||
|
:requires [:nvim-lua/plenary.nvim]}
|
||||||
:junegunn/vim-easy-align {:mod :easyalign}
|
:junegunn/vim-easy-align {:mod :easyalign}
|
||||||
:kovisoft/paredit {}
|
:kovisoft/paredit {:mod :paredit}
|
||||||
:kristijanhusak/vim-dadbod-completion {}
|
:kristijanhusak/vim-dadbod-completion {}
|
||||||
:kristijanhusak/vim-dadbod-ui {}
|
:kristijanhusak/vim-dadbod-ui {}
|
||||||
:neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config
|
:L3MON4D3/LuaSnip {:mod :luasnip}
|
||||||
:norcalli/nvim-colorizer.lua {:mode :colorizer}
|
:lifepillar/vim-solarized8 {}
|
||||||
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope}
|
:lukas-reineke/headlines.nvim {:mod :headlines}
|
||||||
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter :requires [:nvim-treesitter/playground]}
|
; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
|
||||||
|
:mrjones2014/smart-splits.nvim {:mod :smartsplits}
|
||||||
|
:mechatroner/rainbow_csv {}
|
||||||
|
:neovim/nvim-lspconfig {:mod :lspconfig}
|
||||||
|
:norcalli/nvim-colorizer.lua {:mod :colorizer}
|
||||||
|
:nvim-orgmode/orgmode {:mod :orgmode}
|
||||||
|
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim]
|
||||||
|
[:nvim-lua/plenary.nvim]]
|
||||||
|
:mod :telescope}
|
||||||
|
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate"
|
||||||
|
:mod :treesitter}
|
||||||
:nvim-treesitter/playground {}
|
:nvim-treesitter/playground {}
|
||||||
:p00f/nvim-ts-rainbow {}
|
:radenling/vim-dispatch-neovim {}
|
||||||
:radenling/vim-dispatch-neovim {} ; Clojure
|
:RaafatTurki/hex.nvim { :mod :hex }
|
||||||
:skywind3000/asyncrun.vim {} ; :AsyncRun
|
:rafamadriz/friendly-snippets {}
|
||||||
:tpope/vim-classpath {}
|
:skywind3000/asyncrun.vim {}
|
||||||
|
;; :tjdevries/sg.nvim {:run "cargo build --workspace"
|
||||||
|
;; :dependencies [:nvim-lua/plenary.nvim]}
|
||||||
|
;; :tpope/vim-classpath {}
|
||||||
:tpope/vim-dadbod {}
|
:tpope/vim-dadbod {}
|
||||||
:tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies
|
:tpope/vim-dispatch {}
|
||||||
:tpope/vim-fugitive {} ; Git
|
:tpope/vim-fugitive {:mod :fugitive}
|
||||||
:tpope/vim-git {} ; Git Commit Message
|
:tpope/vim-git {}
|
||||||
:tpope/vim-pathogen {}
|
:tpope/vim-pathogen {}
|
||||||
:tpope/vim-rails {}
|
:tpope/vim-rails {}
|
||||||
:tpope/vim-repeat {}
|
:tpope/vim-repeat {}
|
||||||
|
:tpope/vim-rhubarb {}
|
||||||
:tpope/vim-surround {}
|
:tpope/vim-surround {}
|
||||||
:tpope/vim-unimpaired {}
|
:tpope/vim-unimpaired {}
|
||||||
:tpope/vim-vinegar {}
|
:tpope/vim-vinegar {}
|
||||||
:wbthomason/packer.nvim {:mod :packer}
|
:wbthomason/packer.nvim {:mod :packer}
|
||||||
:williamboman/nvim-lsp-installer {} ; NeoVim lsp server installs
|
;; :williamboman/nvim-lsp-installbuilder {}
|
||||||
|
:williamboman/mason.nvim {:mod :mason
|
||||||
|
:requires [:williamboman/mason-lspconfig.nvim]}
|
||||||
|
; NeoVim lsp server installs
|
||||||
|
; :p00f/nvim-ts-rainbow {}
|
||||||
; :luochen1990/rainbow {}
|
; :luochen1990/rainbow {}
|
||||||
; :thecontinium/asyncomplete-conjure.vim {}
|
; :thecontinium/asyncomplete-conjure.vim {}
|
||||||
}
|
; :jose-elias-alvarez/null-ls.nvim {:mod :null-ls
|
||||||
|
; :requires [:nvim-lua/plenary.nvim]}
|
||||||
; :tpope/vim-fireplace {} ; Clojure
|
} ; :tpope/vim-fireplace {} ; Clojure
|
||||||
; :tpope/vim-sexp-mappings-for-regular-people {}
|
; :tpope/vim-sexp-mappings-for-regular-people {}
|
||||||
)
|
)
|
||||||
|
|
||||||
(use packages)
|
(use packages)
|
||||||
|
|
||||||
|
|
||||||
;; call minpac#add('dense-analysis/ale') " Linting
|
;; call minpac#add('dense-analysis/ale') " Linting
|
||||||
;; call minpac#add('editorconfig/editorconfig-vim')
|
;; call minpac#add('editorconfig/editorconfig-vim')
|
||||||
;; call minpac#add('elixir-lang/vim-elixir') " Elixir
|
;; call minpac#add('elixir-lang/vim-elixir') " Elixir
|
||||||
|
|||||||
18
nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl
Normal file
18
nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
(module dotfiles.terraform-helpers
|
||||||
|
{autoload {a aniseed.core}
|
||||||
|
require {anenv aniseed.env nvim aniseed.nvim u dotfiles.util}})
|
||||||
|
|
||||||
|
(fn append-to-buf [bufno lines]
|
||||||
|
(when lines
|
||||||
|
(nvim.buf_set_lines buffno -1 -1 false lines)))
|
||||||
|
|
||||||
|
(var tf-log-bufno nil)
|
||||||
|
|
||||||
|
(fn terraform-import []
|
||||||
|
(vim.fn.jobstart [:terraform :import :-no-color address id]
|
||||||
|
{:stdout_buffered true
|
||||||
|
:on_stdout (fn [_ data]
|
||||||
|
(append-to-buf bufno data))}))
|
||||||
|
|
||||||
|
; (nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false})
|
||||||
|
; (u.nnoremap :<C-W>z ":call ZoomToggle()<CR>")
|
||||||
12
nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl
Normal file
12
nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
(module dotfiles.ts-utils {autoload {nvim aniseed.nvim a aniseed.core}})
|
||||||
|
|
||||||
|
(defn root [bufnr lang] (let [parser (vim.treesitter.get_parser bufnr lang {})
|
||||||
|
tree (a.first (: parser :parse))]
|
||||||
|
(: tree :root)))
|
||||||
|
|
||||||
|
(defn make-query [lang query-string]
|
||||||
|
(let [query (vim.treesitter.query.parse lang "(headline (stars) @stars)")]
|
||||||
|
(fn [bufnr]
|
||||||
|
(let [root-node (root bufnr lang)
|
||||||
|
iter-captures (query.iter_captures query root-node bufnr 0 -1)]
|
||||||
|
iter-captures))))
|
||||||
@@ -1,21 +1,32 @@
|
|||||||
(module dotfiles.util
|
(local a (require :aniseed.core))
|
||||||
{autoload
|
|
||||||
{a aniseed.core}
|
|
||||||
require
|
|
||||||
{nvim aniseed.nvim}})
|
|
||||||
|
|
||||||
|
(fn noremap [mode from to opts]
|
||||||
(defn noremap [mode from to opts]
|
|
||||||
(let [map-opts {:noremap true :silent true}
|
(let [map-opts {:noremap true :silent true}
|
||||||
to (.. ":" to "<cr>")
|
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 (a.get opts :local?) buff-num)
|
||||||
(nvim.buf_set_keymap (or buff-num 0) mode from to map-opts)
|
(vim.api.nvim_buf_set_keymap (or buff-num 0) mode from to map-opts)
|
||||||
(nvim.set_keymap mode from to map-opts))))
|
(vim.api.nvim_set_keymap 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))
|
|
||||||
|
(fn inoremap [from to opts] (noremap :i from to opts))
|
||||||
|
|
||||||
|
(fn vnoremap [from to opts] (noremap :v from to opts))
|
||||||
|
|
||||||
|
(fn lnnoremap [from to] (nnoremap (.. :<leader> from) to))
|
||||||
|
|
||||||
|
(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}
|
||||||
|
|||||||
@@ -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>")
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ 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"] = {
|
||||||
|
|||||||
21
test.md
Normal file
21
test.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Some heading
|
||||||
|
|
||||||
|
```fennel
|
||||||
|
(print)
|
||||||
|
(* 21
|
||||||
|
(+ 1 3))
|
||||||
|
```
|
||||||
|
|
||||||
|
some clojure
|
||||||
|
|
||||||
|
```clojure
|
||||||
|
(print
|
||||||
|
)(* 21
|
||||||
|
(+ 1 3))
|
||||||
|
```
|
||||||
|
|
||||||
|
some python
|
||||||
|
|
||||||
|
```python
|
||||||
|
print( 1 + 3 ) + 3
|
||||||
|
```
|
||||||
50
test.org
Normal file
50
test.org
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
* test
|
||||||
|
** test level 2
|
||||||
|
*** test level 3
|
||||||
|
**** test level 4
|
||||||
|
***** test level 5
|
||||||
|
****** test level 6
|
||||||
|
******* test level 7
|
||||||
|
******** test level 8
|
||||||
|
********* test level 9
|
||||||
|
********** test level 10
|
||||||
|
|
||||||
|
* test 3
|
||||||
|
* test 4
|
||||||
|
|
||||||
|
#+NAME: x
|
||||||
|
3
|
||||||
|
|
||||||
|
- [ ] something
|
||||||
|
- [X] something else
|
||||||
|
- [-] half done ∂
|
||||||
|
|
||||||
|
Some fennel
|
||||||
|
|
||||||
|
#+begin_example ex1
|
||||||
|
dfs
|
||||||
|
#+end_example
|
||||||
|
|
||||||
|
#+name: random
|
||||||
|
#+begin_src fennel
|
||||||
|
(print )
|
||||||
|
(+ 1 (* 3 7))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+results:
|
||||||
|
|
||||||
|
Some Clojure
|
||||||
|
|
||||||
|
#+begin_src clojure
|
||||||
|
(println (* 3 )(+ 1 2) )
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src python :results silent :exports code :var n=0
|
||||||
|
print(1 + 3)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
#+begin_src
|
||||||
|
print(+ 1 3)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
42
tmux.conf
42
tmux.conf
@@ -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
|
||||||
@@ -8,6 +11,8 @@ set -s escape-time 1
|
|||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
setw -g pane-base-index 1
|
setw -g pane-base-index 1
|
||||||
|
|
||||||
|
set -g main-pane-width 160
|
||||||
|
|
||||||
bind r source-file ~/.tmux.conf \; display "Reloaded!"
|
bind r source-file ~/.tmux.conf \; display "Reloaded!"
|
||||||
bind -r '`' clear-history \; display "History Cleared!"
|
bind -r '`' clear-history \; display "History Cleared!"
|
||||||
|
|
||||||
@@ -33,8 +38,8 @@ 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 -s default-terminal "tmux-256color"
|
set -g default-terminal "tmux-256color"
|
||||||
set -g history-limit 6000
|
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
|
||||||
@@ -46,8 +51,9 @@ set -g status-right '#(~/dotfiles/bin/tmux_battery_charge_indicator.sh) #[bg=whi
|
|||||||
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
|
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
|
||||||
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
|
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
|
||||||
|
|
||||||
# set -as terminal-overrides ',xterm-257color:RGB'
|
# set -as terminal-overrides ',xterm-256color:RGB'
|
||||||
set -as terminal-features ',xterm-256color:RGB'
|
set -as terminal-features ',tmux-256color:RGB'
|
||||||
|
set-option -sa terminal-overrides ',tmux-256color:RGB'
|
||||||
|
|
||||||
# Undercurl
|
# Undercurl
|
||||||
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
||||||
@@ -55,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
|
||||||
|
|
||||||
|
|||||||
8
utils/curl-time-format.txt
Normal file
8
utils/curl-time-format.txt
Normal 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
|
||||||
8
utils/utils/curl-time-format.txt
Normal file
8
utils/utils/curl-time-format.txt
Normal 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
|
||||||
Reference in New Issue
Block a user