this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge comment with `do` to make folds nicer

+37 -68
+37 -68
vim/.config/nvim/init.fnl
··· 9 9 10 10 (set opts.shell :fish) 11 11 12 - (do 13 - ; MatchIt must be unloaded for MatchPair to work correctly 12 + (do ; MatchIt must be unloaded for MatchPair to work correctly 14 13 (set vim.g.loaded_matchit true) 15 14 (set vim.g.matchup_surround_enabled true)) 16 15 17 16 (set vim.g.choosewin_label :QWERTYUIOP) 18 17 19 - (do 20 - ; Colors 18 + (do ; Colors 21 19 (ex.colorscheme :blame) 22 20 (opts {:termguicolors true 23 21 :guicursor ["n-v-c-sm:block-Cursor" 24 22 "i-ci-ve:ver25-Cursor" 25 23 "r-cr-o:hor20-Cursor"]})) 26 24 27 - (do 28 - ; Indentation 25 + (do ; Indentation 29 26 (opts {:shiftwidth 2 30 27 :expandtab true 31 28 :textwidth 80 ··· 33 30 :linebreak true 34 31 :formatoptions :tcqjl})) 35 32 36 - (do 37 - ; UI 33 + (do ; UI 38 34 (opts {:lazyredraw true :updatetime 500 :title true :showmode true})) 39 35 40 - (do 41 - ; Display tabs and trailing spaces visually 36 + (do ; Display tabs and trailing spaces visually 42 37 (opts {:fillchars ["vert:┃" "fold:·"] 43 38 :list true 44 39 :listchars ["tab:→ " ··· 48 43 "precedes:↤"] 49 44 :conceallevel 2})) 50 45 51 - (do 52 - ; Ignore case. ; If your code uses different casing to differentiate files, then you need ; mental help 46 + (do ; Ignore case. 47 + ; If your code uses different casing to differentiate files, then you need 48 + ; mental help 53 49 (opts {:wildignorecase true 54 50 :wildmode :full 55 51 :fileignorecase true ··· 68 64 :tags^ [:./**/tags] 69 65 :iskeyword+ ["-"]}) 70 66 71 - (do 72 - ; Autowrite file whenever possible 67 + (do ; Autowrite file whenever possible 73 68 (opts {:hidden false :autowriteall true})) 74 69 75 70 (do ··· 80 75 (on BufEnter "term://*" (set opts.window.scrolloff 0)) 81 76 (on BufLeave "term://*" (set opts.window.scrolloff value))))) 82 77 83 - (do 84 - ; XXI century - we have cursors now 78 + (do ; XXI century - we have cursors now 85 79 (set opts.mouse :a)) 86 80 87 - (do 88 - ; Split in CORRECT places 81 + (do ; Split in CORRECT places 89 82 (opts {:splitright true :splitbelow true})) 90 83 91 - (do 92 - ; Searching 84 + (do ; Searching 93 85 (opts {:ignorecase true :smartcase true :inccommand :nosplit})) 94 86 95 - (do 96 - ; Permanent undo 87 + (do ; Permanent undo 97 88 (set opts.undofile true)) 98 89 99 - (do 100 - ; Save only meaningfull data to sessions 90 + (do ; Save only meaningfull data to sessions 101 91 (set opts.sessionoptions [:blank 102 92 :buffers 103 93 :curdir ··· 106 96 :winsize 107 97 :terminal])) 108 98 109 - (do 110 - ; Folding 99 + (do ; Folding 111 100 (opts {:foldmethod :expr 112 101 :foldexpr "nvim_treesitter#foldexpr()" 113 102 :foldlevel 999}) 114 103 (map :n :<CR> "foldlevel(\".\") ? \"za\" : \"\\<CR>\"" {:expr true})) 115 104 116 - (do 117 - ; Completion 105 + (do ; Completion 118 106 (opts {:complete ["." :w :b :t :k :kspell] 119 107 :completeopt [:menuone :noselect :noinsert]})) 120 108 121 - (do 122 - ; Clap 109 + (do ; Clap 123 110 (map :n :<Space><Space> #(picker.find_files))) 124 111 125 - (do 126 - ; Frequently used unimpaired mappings 112 + (do ; Frequently used unimpaired mappings 127 113 (let [unimpaired (fn [char left right] 128 114 (map :n (.. "[" char) left) 129 115 (map :n (.. "]" char) right))] ··· 133 119 (unimpaired :l ":lprev" ":lnext") 134 120 (unimpaired :L ":lpfile" ":lnfile"))) 135 121 136 - (do 137 - ; Additional "Close" commands 122 + (do ; Additional "Close" commands 138 123 (map :n :ZS ":wa") 139 124 (map :n :ZA ":qa") 140 125 (map :n :ZX ":cq")) 141 126 142 - (do 143 - ; Swap ; and : for easier command line mode 127 + (do ; Swap ; and : for easier command line mode 144 128 (let [swap (fn [a b] 145 129 (map :nx a b) 146 130 (map :nx b a))] 147 131 (swap ";" ":") 148 132 (map :n "q;" "q:"))) 149 133 150 - (do 151 - ; Expand abbreviation when hitted <CR> 134 + (do ; Expand abbreviation when hitted <CR> 152 135 (map :i :<CR> "<C-]><CR>")) 153 136 154 - (do 155 - ; Make Vim behaviour consistent 137 + (do ; Make Vim behaviour consistent 156 138 (map :n :Y :y$)) 157 139 158 - (do 159 - ; Code formatting 140 + (do ; Code formatting 160 141 (map :n :g= "=aGg``") 161 142 (map :nx :Q :gq) 162 143 (map :n :gQ "gqaG``")) 163 144 164 - (do 165 - ; Smart `0` ; Goes to the beginning of the text at first and later goes to the beginning of 145 + (do ; Smart `0` 146 + ; Goes to the beginning of the text at first and later goes to the beginning of 166 147 ; the line, alternates afterwards 167 148 (map :n :0 "virtcol('.') - 1 <= indent('.') && col('.') > 1 ? '0' : '_'" 168 149 {:expr true})) 169 150 170 - (do 171 - ; Help viewing and opening URLs 151 + (do ; Help viewing and opening URLs 172 152 (map :n :gK ":Dash") 173 153 (map :n :gq (fn [] 174 154 (let [name (func.expand :<cfile>)] 175 155 (func.jobstart [:open name] {:detach true}) 176 156 (print :Open name))))) 177 157 178 - (do 179 - ; Text object for whole file 158 + (do ; Text object for whole file 180 159 (map :o :aG ":normal! ggVG")) 181 160 182 - (do 183 - ; Quickly disable highligh 161 + (do ; Quickly disable highligh 184 162 (map :n "<Space>," ":nohlsearch")) 185 163 186 - (do 187 - ; Terminal mappings 164 + (do ; Terminal mappings 188 165 (map :n :<C-q> :<Nop>) 189 166 (map :n :<C-q>c ":term") 190 167 (map :n :<C-q>s ":split +term") ··· 196 173 (when (executable? :nvr) 197 174 (set vim.env.EDITOR "nvr -cc split -c 'set bufhidden=delete' --remote-wait"))) 198 175 199 - (do 200 - ; Git mappings 176 + (do ; Git mappings 201 177 (let [leader :U 202 178 git-map (fn [lhs cmd] 203 179 (map :n (.. leader lhs) (.. ":Git " cmd)))] ··· 211 187 (git-map :u :pull) 212 188 (git-map :g :log))) 213 189 214 - (do 215 - ; Split management 190 + (do ; Split management 216 191 (map :n :<C-w><C-w> "<plug>(choosewin)" {:noremap false}) 217 192 (map :n :<C-_> "<plug>(choosewin)" {:noremap false})) 218 193 219 - (do 220 - ; Search 194 + (do ; Search 221 195 (when (executable? :rg) 222 196 (opts {:grepprg "rg --vimgrep --no-heading --smart-case" 223 197 :grepformat "%f:%l:%c:%m,%f:%l%m,%f %l%m"}))) 224 198 225 - (do 226 - ; Matchparen 199 + (do ; Matchparen 227 200 (set vim.g.matchup_matchparen_offscreen {:method :popup}) 228 201 (augroup matchparen 229 202 (let [term "term://*"] 230 203 (on BufEnter term (ex.NoMatchParen)) 231 204 (on BufLeave term (ex.DoMatchParen))))) 232 205 233 - (do 234 - ; Autoreload Direnv after writing the .envrc 206 + (do ; Autoreload Direnv after writing the .envrc 235 207 (when (executable? :direnv) 236 208 (augroup autoreload-envrc 237 209 (on BufWritePost :.envrc (ex.silent "!direnv allow %"))))) 238 210 239 - (do 240 - ; Setup Lua extensions 211 + (do ; Setup Lua extensions 241 212 (let [setup (fn [package object] 242 213 ((. (require package) :setup) object))] 243 214 (setup :startify {:lists [{:type :sessions :header [" Sessions"]} ··· 264 235 265 236 (defcommand Clean "keeppatterns %s/\\s\\+$//e | set nohlsearch") 266 237 267 - (do 268 - ; Async Make and Grep 238 + (do ; Async Make and Grep 269 239 (let [run (fn [args f-args] 270 240 (api.call-function "asyncdo#run" (vim.list_extend args f-args)))] 271 241 (defcommand Make {:bang true :nargs "*" :complete :file} ··· 284 254 285 255 (defcommand Dash {:nargs "?"} (func.dash#open q-args)) 286 256 287 - (do 288 - ; Setup vim-sandwitch 257 + (do ; Setup vim-sandwitch 289 258 (ex.packadd! :vim-sandwich) 290 259 (ex.runtime :macros/sandwich/keymap/surround.vim)) 291 260