Compare commits
	
		
			12 commits
		
	
	
		
			main
			...
			nvim-rewri
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | c313ef0f39 | ||
|  | b096dcc502 | ||
|  | 0c331b8db8 | ||
|  | 622e381157 | ||
|  | ac06734c3b | ||
|  | 17e51c791d | ||
|  | f7d7d75bb3 | ||
|  | 10f6614348 | ||
|  | 0709b64a71 | ||
|  | 7fab1f798c | ||
|  | d623b21234 | ||
|  | 0f34a00a4e | 
|  | @ -133,7 +133,6 @@ | |||
|     autosuggestion.enable = false; | ||||
| 
 | ||||
|     initExtra = '' | ||||
|       bindkey -v | ||||
|       autopair-init | ||||
|     ''; | ||||
|     sessionVariables = { | ||||
|  |  | |||
							
								
								
									
										4
									
								
								home/profiles/nvim/config/after/syntax/vimwiki.vim
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								home/profiles/nvim/config/after/syntax/vimwiki.vim
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| " match with %update | ||||
| syntax match VimwikiPlaceholder /^\s*%update\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite | ||||
| " match with %link | ||||
| syntax match VimwikiPlaceholder /^\s*%link\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite | ||||
							
								
								
									
										11
									
								
								home/profiles/nvim/config/fnl/conf/formatting.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								home/profiles/nvim/config/fnl/conf/formatting.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| (import-macros {: do-req } :lib/macros) | ||||
| 
 | ||||
| (do-req :conform :setup  | ||||
|         {:formatters_by_ft {:lua ["stylua"] | ||||
|                             :nix ["nixfmt"] | ||||
|                             ; :go ["goimports" "gofmt"] ; Go handled in special case | ||||
|                             :terraform ["terraform_fmt"] | ||||
|                             :sh ["shfmt"] | ||||
|                             :bazel ["buildifier"]} | ||||
|          :format_on_save {:lsp_format "fallback" | ||||
|                           :timeout_ms 500}}) | ||||
							
								
								
									
										47
									
								
								home/profiles/nvim/config/fnl/conf/init.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								home/profiles/nvim/config/fnl/conf/init.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,47 @@ | |||
| (local nvim (require :lib/nvim)) | ||||
| 
 | ||||
| (nvim.g :mapleader " ") | ||||
| 
 | ||||
| ; (nvim.opt :runtimepath (.. vim.opt.runtimepath "/home/anish/.config/nvim/,")) | ||||
| (nvim.opt :tabstop 2) | ||||
| (nvim.opt :showmatch true) | ||||
| (nvim.opt :shiftwidth 2) | ||||
| (nvim.opt :autoindent true) | ||||
| (nvim.opt :undofile true) | ||||
| (nvim.opt :signcolumn "auto:4") | ||||
| (nvim.opt :title true) | ||||
| (nvim.opt :number true) | ||||
| ; (nvim.opt :nocompatible) | ||||
| (nvim.opt :relativenumber true) | ||||
| (nvim.opt :showtabline 2) | ||||
| (nvim.opt :expandtab true) | ||||
| (nvim.opt :autowriteall true) | ||||
| (nvim.opt :cmdheight 2) | ||||
| (nvim.opt :spelllang "en_gb") | ||||
| (nvim.opt :ignorecase true) | ||||
| (nvim.opt :smartcase true) | ||||
| (nvim.opt :incsearch true) | ||||
| (nvim.opt :updatetime 300) ; Diagnostics response time | ||||
| (nvim.opt :signcolumn "yes") | ||||
| (nvim.opt :cursorline true) | ||||
| 
 | ||||
| (nvim.opt :lisp true) ; include - in word to move better in snake-case) | ||||
| (nvim.g :sexp_filetypes "clojure,scheme,lisp,janet,fennel,yuck") ; include the lisps I use | ||||
| 
 | ||||
| (nvim.opt :termguicolors) | ||||
| (nvim.colorscheme "ayu-mirage") | ||||
| 
 | ||||
| (require :conf.plugins) | ||||
| (require :conf.mappings) | ||||
| (require :conf.lsp) | ||||
| (require :conf.plugins.cmp) | ||||
| (require :conf.formatting) | ||||
| ; (require :conf.kitaab) | ||||
| 
 | ||||
| ; Spelling | ||||
| (vim.api.nvim_create_autocmd ["BufRead" "BufNewFile"]  | ||||
|                              {:pattern ["*.wiki" "*.txt" "*.md" "*.tex"] | ||||
|                               :command "setlocal spell"}) | ||||
| (vim.api.nvim_create_autocmd ["FileType"] | ||||
|                              {:pattern ["mail"] | ||||
|                               :command "setlocal spell"}) | ||||
							
								
								
									
										99
									
								
								home/profiles/nvim/config/fnl/conf/lsp.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								home/profiles/nvim/config/fnl/conf/lsp.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,99 @@ | |||
| (import-macros {: do-req } :lib/macros) | ||||
| (local lspkind (require :lspkind)) | ||||
| (local lspconfig (require :lspconfig)) | ||||
| ; (local lspsaga (require :lspsaga)) | ||||
| (local cmp (require :cmp)) | ||||
| (local nvim (require :lib/nvim)) | ||||
| ; (local lspfuzzy (require :lspfuzzy)) ; Not available on Nix | ||||
| ; (local sg (require :sg)) | ||||
| ; (local lsputil (require :lspconfig/util)) | ||||
| 
 | ||||
| ;(lspsaga.setup {:border_style "rounded" | ||||
| ;                :code_action_icon "" | ||||
| ;                :code_action_num_shortcut false | ||||
| ;                :ui {:code_action ""} | ||||
| ;                :show_outline {:enable false})) | ||||
| ; | ||||
| ;(nvim.opt :winbar nil) | ||||
| 
 | ||||
| (local signs {:Error " "  | ||||
|               :Warn " "  | ||||
|               :Hint " "  | ||||
|               :Info " "}) | ||||
| (each [t icon (pairs signs)] | ||||
|   (let [hl (.. "DiagnosticSign" t)] | ||||
|     (vim.fn.sign_define hl {:text icon | ||||
|                             :texthl hl | ||||
|                             :numhl hl}))) | ||||
| 
 | ||||
| (tset vim.lsp.handlers  | ||||
|       :textDocument/hover  | ||||
|       (vim.lsp.with vim.lsp.handlers.hover  | ||||
|                     {:focusable false :border "rounded"})) | ||||
| (tset vim.lsp.handlers | ||||
|       :textDocument/signatureHelp | ||||
|       (vim.lsp.with vim.lsp.handlers.signature_help | ||||
|                     {:focusable false :border "rounded"})) | ||||
| 
 | ||||
| (local capabilities (let [cmp_nvim_lsp (require :cmp_nvim_lsp)] | ||||
|                       (cmp_nvim_lsp.default_capabilities))) | ||||
| 
 | ||||
| (local formatting-augroup (nvim.augroup :LspFormatting)) | ||||
| 
 | ||||
| (fn goimports [wait-ms] | ||||
|   (let [params (vim.lsp.util.make_range_params)  | ||||
|          result (do | ||||
|                  (tset params :context {:only [:source.organizeImports]}) | ||||
|                  (vim.lsp.buf_request_sync 0 :textDocument/codeAction params wait-ms))] | ||||
|        (each [_ res (pairs (or result {}))] | ||||
|          (each [_ r (pairs (or res.result {}))] | ||||
|            (if r.edit | ||||
|                (vim.lsp.util.apply_workspace_edit r.edit "utf-16") | ||||
|                (vim.lsp.buf.execute_command r.command)))) | ||||
|    (vim.lsp.buf.format))) | ||||
| 
 | ||||
| (fn on-attach [client bufnr] | ||||
|               (let [filetype (vim.api.nvim_buf_get_option 0 "filetype")] | ||||
|                 (if (client.supports_method "textDocument/formatting") | ||||
|                     (do (nvim.autocmd "BufWritePre" | ||||
|                                       {:group formatting-augroup | ||||
|                                        :buffer bufnr | ||||
|                                        :callback (fn [_] (if (= filetype "go") | ||||
|                                                              (goimports 2000) | ||||
|                                                              (vim.lsp.buf.format {:bufnr bufnr})))}))))) | ||||
| 
 | ||||
| (lspconfig.gopls.setup  | ||||
|   {:capabilities capabilities | ||||
|    :codelens {:generate true :gc_details true} | ||||
|    :semanticTokens true | ||||
|    :flags {:debounce_text_changes 200} | ||||
|    :analyses {:unusedparams true | ||||
|               :unusedvariables true | ||||
|               :unusedwrite true | ||||
|               :nilness true | ||||
|               :unusedwrite true | ||||
|               :useany true} | ||||
|    :completeUnimported true | ||||
|    :staticcheck true | ||||
|    :experimentalPostfixCompletions true | ||||
|    :hints {:constantValues true | ||||
|            :functionTypeParameters true    | ||||
|            :assignVariablesTypes true | ||||
|            :compositeLiteralTypes true | ||||
|            :compositeLiteralFields true | ||||
|            :parameterNames true | ||||
|            :rangeVariableTypes true} | ||||
|    :on_attach on-attach}) | ||||
| 
 | ||||
| (local lsps [:nil_ls :terraform_lsp :fennel_ls :tsserver :starbin]) | ||||
| (each [index lsp (ipairs lsps)] | ||||
|   ((. (. lspconfig lsp) :setup) {})) | ||||
| 
 | ||||
| ; null-ls | ||||
| (let [null-ls (require :null-ls)] | ||||
|   (null-ls.setup {:sources [; TODO fix these | ||||
|                             ;null-ls.builtins.diagnostics.shellcheck | ||||
|                             null-ls.builtins.diagnostics.commitlint]})) | ||||
|                             ;null-ls.builtins.diagnostics.jsonlint]})) | ||||
|                             ;(null-ls.builtins.diagnostics.proselint.with {:filetypes ["vimwiki" "mail"]})]})) | ||||
| 
 | ||||
							
								
								
									
										135
									
								
								home/profiles/nvim/config/fnl/conf/mappings.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										135
									
								
								home/profiles/nvim/config/fnl/conf/mappings.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,135 @@ | |||
| (local nvim (require :lib/nvim)) | ||||
| (import-macros {: do-req } :lib/macros) | ||||
| 
 | ||||
| (local wk (require :which-key)) | ||||
| 
 | ||||
| ;; Convenient way to indent stuff in visual mode | ||||
| (nvim.keymap [:v] "<" "<gv" {:noremap true}) | ||||
| (nvim.keymap [:v] ">" ">gv" {:noremap true}) | ||||
| (nvim.keymap [:n] "<space>" "<NOP>" {:noremap true :silent true}) | ||||
| ;; Convenient way to move stuff in visual mode | ||||
| (nvim.keymap [:v] "J" ":m '>+1<CR>gv=gv" {:noremap true}) | ||||
| (nvim.keymap [:v] "K" ":m '>-2<CR>gv=gv" {:noremap true}) | ||||
| ;; Convientent screen shifting  | ||||
| (nvim.keymap [:n] "n" "nzzzv" {:noremap true}) | ||||
| (nvim.keymap [:n] "N" "Nzzzv" {:noremap true}) | ||||
| (nvim.keymap [:n] "J" "mzJ'z" {:noremap true}) | ||||
| ; Fix Y | ||||
| (nvim.keymap [:n] "Y" "y$") | ||||
| ; Unmap Q | ||||
| (nvim.keymap [] "Q" "<Nop>") | ||||
| 
 | ||||
| ; FTerm | ||||
| (vim.api.nvim_create_user_command "FTermToggle" (fn [_]  | ||||
|                                                   ((-> (require :FTerm)  | ||||
|                                                       (. :toggle))))  | ||||
|                                   {:bang true}) | ||||
| (nvim.keymap [:t] "<TAB>" "<cmd>:FTermToggle<CR>") | ||||
| (nvim.keymap [:n] "<TAB>" "<cmd>:FTermToggle<CR>" {:noremap true}) | ||||
| 
 | ||||
| ; Buffer Movement | ||||
| (nvim.keymap [:n] "gT" ":BufferPrevious<CR>" {:silent true :noremap true})  | ||||
| (nvim.keymap [:n] "gt" ":BufferNext<CR>" {:silent true :noremap true})  | ||||
| (nvim.keymap [:n] "gj" ":BufferPick<CR>" {:silent true :noremap true})  | ||||
| (nvim.keymap [:n] "gb" ":Telescope buffers<CR>" {:silent true :noremap true})  | ||||
| (nvim.keymap [:n] "gq" ":BufferClose<CR>" {:silent true :noremap true})  | ||||
| 
 | ||||
| ; Flash | ||||
| (vim.api.nvim_create_user_command "Flash" (fn [_] (do-req :flash :jump)) {}) | ||||
| (vim.api.nvim_create_user_command "FlashTreesitter" (fn [] (do-req :flash :treesitter)) {}) | ||||
| (nvim.keymap [:n] "f" "<cmd>Flash<CR>")  | ||||
| (nvim.keymap [:n] "s" "<cmd>FlashTreesitter<CR>")  | ||||
| 
 | ||||
| (local | ||||
|   normal-map-leader | ||||
|   {"t" [":Neotree toggle<CR>" | ||||
|         "Toggle neo-tree"] | ||||
|    "w" ["<cmd>:w<cr>" | ||||
|         "Write file"] | ||||
|    "q" ["<cmd>:q<cr>" | ||||
|         "Quit"] | ||||
|    "r" [":RainbowParenthesesToggleAll<CR>" | ||||
|         "Toggle Rainbow Parens"] | ||||
|    "u" [":UndotreeToggle<CR>" | ||||
|         "Toggle Undo Tree"] | ||||
|    ; Telescope  | ||||
|    "f" {:name "Files" | ||||
|         :f ["<cmd>Telescope find_files<cr>" | ||||
|              "Find Files (in Telescope)"] | ||||
|         :g ["<cmd>Telescope live_grep<cr>" | ||||
|              "Find Grep (in Telescope)"] | ||||
|         :b ["<cmd>Telescope buffers<cr>" | ||||
|              "Find Buffers"] | ||||
|         :h ["<cmd>Telescope help_tags<cr>" | ||||
|              "Find Help"] | ||||
|         :t ["<cmd>Telescope tags<cr>" | ||||
|             "Find Tags"] | ||||
|         :r ["<cmd>Telescope oldfiles<CR>" | ||||
|             "Recent files"]} | ||||
|    ; Git | ||||
|    "g" {:name "Git" | ||||
|          "s" [":G<CR>" | ||||
|               "Git Status"] | ||||
|          "f" [":G fetch --all<cr>" | ||||
|               "Git Fetch"] | ||||
|          "b" [":GBranches<cr>" | ||||
|               "Git Branch"] | ||||
|          "p" [":Git! push<cr>" | ||||
|               "Git Push"] | ||||
|          "d" [":GDiff<cr>" | ||||
|               "Git Diff"] | ||||
|          "h" ["" | ||||
|               "Commit Hunk under Cursor"]} | ||||
|          ; For handling merges | ||||
|          ;     nmap <leader>gl :diffget //3<CR> | ||||
|          ;     nmap <leader>gh :diffget //2<CR> | ||||
|          ;     nnoremap <leader>gc :G commit -v -q %:p<CR> | ||||
|    ; Buffers | ||||
|    "b" {:name "Buffer" | ||||
|         :b ["<cmd>:Telescope buffers<CR>" | ||||
|             "Buffer List"] | ||||
|         :q ["<cmd>:BufferClose<CR>" | ||||
|              "Buffer Quit"] | ||||
|         :n ["<cmd>:BufferNext<CR>" | ||||
|             "Buffer Next"] | ||||
|         :N ["<cmd>:tabp<CR>" | ||||
|             "Buffer Previous"] | ||||
|         :p ["<cmd>:tabp<CR>" | ||||
|             "Buffer Previous"]} | ||||
|    ; Search | ||||
|    "s" {:name "Search" | ||||
|         :b ["<cmd>Telescope current_buffer_fuzzy_find<CR>" | ||||
|             "Search in current buffer"] | ||||
|         :s ["<cmd>Telescope live_grep<CR>" | ||||
|             "Search in project"] | ||||
|         :t ["<cmd>TodoTelescope<CR>" | ||||
|             "Search TODOs in project"] | ||||
|         :c ["<cmd>let @/ = \"\"<CR>:echo 'Search highlight cleared'<CR>" | ||||
|             "Clear search"]} | ||||
|    ; Code | ||||
|    "c" {:name "Code" | ||||
|         :d [":lua vim.lsp.buf.definition()<CR>" | ||||
|             "Go to Definition"] | ||||
|         :i [":lua require('telescope.builtin').lsp_implementation()<CR>" | ||||
|             "Implementation"] | ||||
|         :s [":lua vim.lsp.buf.signature_help()<CR>" | ||||
|             "Signature Help"] | ||||
|         :r [":Lspsaga rename<CR>" | ||||
|             "Rename Symbol"] | ||||
|         :h [":Lspsaga hover_doc<CR>" | ||||
|             "Hover doc"] | ||||
|         :o ["<cmd>AerialToggle!<CR>" | ||||
|             "Outline"] | ||||
|         :t [":LspDiagnostics 0" | ||||
|             "Find Errors in Buffer"]} | ||||
|    ; Kitaab | ||||
|    "z" {:name "Kitaab" | ||||
|         :n [":ZettelNew<CR>" | ||||
|             "Zettel New"]} | ||||
|    "v" {:name "Tabs" | ||||
|         :v [":vnew<CR>" | ||||
|             "Vertical Split"] | ||||
|         :h [":new<CR>" | ||||
|             "Horizontal Split"]}}) | ||||
| 
 | ||||
| (wk.register normal-map-leader {:prefix "<leader>"}) | ||||
							
								
								
									
										30
									
								
								home/profiles/nvim/config/fnl/conf/music.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								home/profiles/nvim/config/fnl/conf/music.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,30 @@ | |||
| (local nvim (require :lib/nvim)) | ||||
| 
 | ||||
| (nvim.g :tidal_target "terminal") | ||||
| (nvim.g :scnvim_snippet_format "luasnip") | ||||
| 
 | ||||
| ; -- supercollider | ||||
| ; local scnvim = require 'scnvim' | ||||
| ; local map = scnvim.map | ||||
| ; local map_expr = scnvim.map_expr | ||||
| ; scnvim.setup { | ||||
| ;   keymaps = { | ||||
| ;     ['<localleader>e'] = map('editor.send_line', {'i', 'n'}), | ||||
| ;     ['<localleader>s'] = map_expr('CmdPeriod.run', {'i', 'n'}), | ||||
| ;     ['<localleader>t'] = { | ||||
| ;       map('editor.send_block', {'i', 'n'}), | ||||
| ;       map('editor.send_selection', 'x'), | ||||
| ;     }, | ||||
| ;     ['<CR>'] = map('postwin.toggle'), | ||||
| ;     ['<M-CR>'] = map('postwin.toggle', 'i'), | ||||
| ;     ['<M-L>'] = map('postwin.clear', {'n', 'i'}), | ||||
| ;     ['<C-k>'] = map('signature.show', {'n', 'i'}), | ||||
| ;     ['<F12>'] = map('sclang.hard_stop', {'n', 'x', 'i'}), | ||||
| ;     ['<leader>st'] = map('sclang.start'), | ||||
| ;     ['<leader>sk'] = map('sclang.recompile'), | ||||
| ;     ['<F1>'] = map_expr('s.boot'), | ||||
| ;     ['<F2>'] = map_expr('s.meter'), | ||||
| ;   } | ||||
| ; }  | ||||
| ; -- You gotta run :SCNvimGenerateAssets for this first | ||||
| ; -- require("luasnip").add_snippets("supercollider", require("scnvim/utils").get_snippets()) | ||||
							
								
								
									
										45
									
								
								home/profiles/nvim/config/fnl/conf/plugins.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								home/profiles/nvim/config/fnl/conf/plugins.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| (local nvim (require :lib/nvim)) | ||||
| (local navic (require :nvim-navic)) | ||||
| 
 | ||||
| (import-macros {: do-req } :lib/macros) | ||||
| 
 | ||||
| (let  [lualine (require :lualine)] | ||||
|   (lualine.setup {:options {:theme "ayu"} | ||||
|                   :sections {; :lualine_c [:filename (fn [] | ||||
|                              ;                         (let [lspsaga (require :lspsaga.symbol.winbar)] | ||||
|                              ;                           (lspsaga.get_bar)) | ||||
|                              :lualine_y [(fn [] | ||||
|                                            (var msg "No Active LSP") | ||||
|                                            (let [buf_ft (vim.api.nvim_buf_get_option 0 "filetype") | ||||
|                                                  clients (vim.lsp.get_active_clients)] | ||||
|                                              (each [_ client (ipairs clients)] | ||||
|                                                (let [filetypes (. client :config :filetypes)] | ||||
|                                                  (if (and filetypes (vim.fn.index filetypes buf_ft)) (set msg client.name)))) | ||||
|                                              msg))] | ||||
|                              :lualine_x [:filetype]}})) | ||||
| 
 | ||||
| (require :neo-tree) | ||||
| (do-req :gitsigns :setup) | ||||
| (do-req :marks :setup) | ||||
| ; (do-req :mini.pairs :setup) | ||||
| (do-req :mini.diff :setup) | ||||
| (do-req :mini.ai :setup) | ||||
| (do-req :mini.surround :setup {:mappings {:add "ys" | ||||
|                                           :delete "ds" | ||||
|                                           :replace "cs"}}) | ||||
| (do-req :todo-comments :setup) | ||||
| (do-req :ibl :setup {:scope {:exclude {:language ["fennel" "clojure" "janet"]}}}) | ||||
| 
 | ||||
| (do-req :nvim-treesitter.configs :setup {:highlight {:enable true} | ||||
|                                          :textobjects {:enable true} | ||||
|                                          :indent {:enable true}}) | ||||
| (do-req :treesitter-context :setup {:max_lines 5}) | ||||
| 
 | ||||
| (do-req :auto-session :setup {:log_level "info" | ||||
|                               :auto_session_suppress_dirs ["~/"]}) | ||||
| (nvim.opt :sessionoptions "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal") | ||||
| 
 | ||||
| (do-req :aerial :setup {}) ;{:on_attach (fn [bufnr]  | ||||
|                        ;              (do  | ||||
|                        ;                (vim.keymap.set "n" "{" "<cmd>AerialPrev<CR>" { :buffer bufnr}) | ||||
|                        ;                (vim.keymap.set "n" "}" "<cmd>AerialNext<CR>" { :buffer bufnr})) | ||||
							
								
								
									
										35
									
								
								home/profiles/nvim/config/fnl/conf/plugins/cmp.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								home/profiles/nvim/config/fnl/conf/plugins/cmp.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| (local cmp (require :cmp)) | ||||
| 
 | ||||
| (fn has-words-before [] | ||||
|   (let [(line col) (unpack (vim.api.nvim_win_get_cursor 0)) | ||||
|         cur-line (. (vim.api.nvim_buf_get_lines 0 | ||||
|                                           (- line 1) | ||||
|                                           line | ||||
|                                           true | ||||
|                       1))] | ||||
|     (and (not= col 0) | ||||
|          (= (: (: cur-line :sub col col) :match "%s") | ||||
|             nil)))) | ||||
| 
 | ||||
| (let [lspkind (require :lspkind)] | ||||
|   (cmp.setup {:formatting {:format (lspkind.cmp_format {:mode "symbol_text" | ||||
|                                                         :maxwidth 50}) | ||||
|                            :show_labelDetails true} | ||||
|               :snippet {:expand (fn [args] (vim.snippet.expand args.body))} | ||||
|               :sources [{:name "buffer"}      {:name "nvim_lsp"}  | ||||
|                         {:name "look"}        {:name "path"} | ||||
|                         {:name "calc"}        {:name "spell"} | ||||
|                         {:name "tags"}] | ||||
|               :mapping {"<C-d>" (cmp.mapping.scroll_docs -4) | ||||
|                         "<C-u>" (cmp.mapping.scroll_docs 4) | ||||
|                         "<C-g>" (cmp.mapping.close) | ||||
|                         "<CR>" (cmp.mapping.confirm {:select true}) | ||||
|                         "<Tab>" (cmp.mapping (fn [fallback] | ||||
|                                                (if (cmp.visible) (cmp.select_next_item) | ||||
|                                                    (has-words-before) (cmp.complete) | ||||
|                                                    (fallback)))  | ||||
|                                              [:i :s]) | ||||
|                         "<S-Tab>" (cmp.mapping (fn [fallback] | ||||
|                                                  (if (cmp.visible) (cmp.select_prev_item) | ||||
|                                                      (fallback)))  | ||||
|                                                [:i :s])}})) | ||||
							
								
								
									
										35
									
								
								home/profiles/nvim/config/fnl/conf/plugins/kitaab.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								home/profiles/nvim/config/fnl/conf/plugins/kitaab.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| ; Kitaab is why I'm so tied to vim.  | ||||
| ; If only I could find a nice notes editor...  | ||||
| 
 | ||||
| (local nvim (require :lib/nvim)) | ||||
| 
 | ||||
| (import-macros {: do-req } :lib/macros) | ||||
| 
 | ||||
| (nvim.g :vimwiki_list [{:path "~/kitaab/vimwiki"  | ||||
|                         :auto_tags 1  | ||||
|                         :auto_diary_index 1  | ||||
|                         :auto_generate_links 0  | ||||
|                         :nested_syntaxes {:python "python"  | ||||
|                                           :c++ "cpp"  | ||||
|                                           :nix "nix"  | ||||
|                                           :bash "sh"}}]) | ||||
| (nvim.g :zettel_format "%y%m%d-%H%M") | ||||
| 
 | ||||
| ;  Custom functions | ||||
| (fn update_date [] | ||||
|   (var written false) | ||||
|   (let [time (os.date "%Y-%m-%d %H:%M") | ||||
|         message (.. "%update " time) | ||||
|         lines (vim.api.nvim_buf_get_lines 0 0 4 false)] | ||||
|     (each [index line (ipairs lines)] | ||||
|       (if (and (= (length line) 0) (not written)) | ||||
|         (do  | ||||
|           (vim.api.nvim_buf_set_lines 0 (- index 1) index false [message ""]) | ||||
|           (set written true))) | ||||
|       (if (and (= index 4) (not written)) | ||||
|         (vim.api.nvim_buf_set_lines 0 3 index false [message]))))) | ||||
| 
 | ||||
| (vim.api.nvim_create_autocmd "BufWritePre" {:pattern ["*.wiki"] | ||||
|                                             :callback update_date}) | ||||
| 
 | ||||
| (do-req :hologram :setup {:auto_display false}) | ||||
							
								
								
									
										6
									
								
								home/profiles/nvim/config/fnl/lib/macros.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								home/profiles/nvim/config/fnl/lib/macros.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| (fn do-req [mod key ...] | ||||
|   `(let [name# (require ,mod) | ||||
|          fun# (. name# ,key)] | ||||
|      (fun# ,...))) | ||||
| 
 | ||||
| {: do-req} | ||||
							
								
								
									
										37
									
								
								home/profiles/nvim/config/fnl/lib/nvim.fnl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								home/profiles/nvim/config/fnl/lib/nvim.fnl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,37 @@ | |||
| (fn autocmd [events opts] | ||||
|   "Create autocommand" | ||||
|   (vim.api.nvim_create_autocmd events opts)) | ||||
| 
 | ||||
| (fn clear-autocmds [opts] | ||||
|   "Clear autocommands" | ||||
|   (vim.api.nvim_clear_autocmds opts)) | ||||
| 
 | ||||
| (fn augroup [name ?opts] | ||||
|   "Create autocommand group" | ||||
|   (vim.api.nvim_create_augroup name (or ?opts {}))) | ||||
| 
 | ||||
| (fn keymap [mode lhs rhs ?opts] | ||||
|   "Sets a global mapping for the given mode. | ||||
|   Ex: `(keymap [:n :i] ...)`" | ||||
|   (let [string-mode (table.concat mode)] | ||||
|     (vim.api.nvim_set_keymap string-mode lhs rhs (or ?opts {})))) | ||||
| 
 | ||||
| (fn opt [key value] | ||||
|   "Set a vim option" | ||||
|   (tset vim.opt key value)) | ||||
| 
 | ||||
| (fn g [key value] | ||||
|   "Set a vim global" | ||||
|   (tset vim.g key value)) | ||||
| 
 | ||||
| (fn colorscheme [name] | ||||
|   "Set the current colorscheme" | ||||
|   (vim.cmd (.. "colorscheme " name))) | ||||
| 
 | ||||
| {: autocmd | ||||
|  : clear-autocmds | ||||
|  : augroup | ||||
|  : keymap | ||||
|  : opt | ||||
|  : g | ||||
|  : colorscheme} | ||||
							
								
								
									
										26
									
								
								home/profiles/nvim/config/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								home/profiles/nvim/config/init.lua
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| if pcall(require, "hotpot") then | ||||
|   -- Setup hotpot.nvim | ||||
|   require("hotpot").setup({ | ||||
|     provide_require_fennel = true, | ||||
|     -- show fennel compiler results in when editing fennel files | ||||
|     enable_hotpot_diagnostics = true, | ||||
|     compiler = { | ||||
|       -- options passed to fennel.compile for modules, defaults to {} | ||||
|       modules = { | ||||
|         -- not default but recommended, align lua lines with fnl source | ||||
|         -- for more debuggable errors, but less readable lua. | ||||
|         correlate = true | ||||
|       }, | ||||
|       macros = { | ||||
|         -- allow macros to access vim global, needed for nyoom modules | ||||
|         env = "_COMPILER", | ||||
|         compilerEnv = _G, | ||||
|         allowGlobals = true, | ||||
|       }, | ||||
|     } | ||||
|   }) | ||||
|   -- Import neovim configuration | ||||
|   require("conf") | ||||
| else | ||||
|   print("Unable to require hotpot") | ||||
| end | ||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							|  | @ -4,7 +4,8 @@ | |||
|   programs.zsh.enable = true; | ||||
|   users.users.anish = { | ||||
|     description = "Personal user for Anish"; | ||||
|     hashedPassword = "$y$j9T$y3DPt/dWaPE.gRazQqw1w0$1RMH5sl/Nu8kW3ZMywYCPRniHD/jF5qRh0VKrdJ.bV2"; | ||||
|     hashedPassword = | ||||
|       "$y$j9T$y3DPt/dWaPE.gRazQqw1w0$1RMH5sl/Nu8kW3ZMywYCPRniHD/jF5qRh0VKrdJ.bV2"; | ||||
|     shell = pkgs.zsh; | ||||
|     isNormalUser = true; | ||||
|     extraGroups = [ "wheel" "audio" "networkmanager" "video" ]; | ||||
|  | @ -15,6 +16,8 @@ | |||
|       "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDtU2GMYjXj6RGO1+mwM4TDGOo0qrKLTL4Di8+QgDX0p5vUEsnE1PS9wnuqCmSu75U8g0XIAMtvtdYyGk1N+Bx01erAZpT8DLYtIXFCyaiN28PVu5T1D0T+TQ7xgIH1qenXZR2DOQdf6kpvKEfm7+7bWhCo0N/KFMpmReubyzHDQcq/1qQasxTL+YALQFOjwKqsOTBXbHwZ103AEAcQX4ftBFEOfVli4/1aKIK4dNSZYB7J9Htq707YnsEqo9RLAMh0aOTTYgTx9AoSUDeqGuh/AGkcB7NcS7EEtI6d5YUGylwZh/gF6hqE0jl8kn2m5jMKXL3CRohZvjifue8x/GIjpu5WRabUuhBEbrfTQQaC7taHnt5rvYCGzKZx09TexUzhuz2CL480DRoxSG+P+lCNm1dIg/EZrnGEzXCSr36PlOqS5t5gm8tPkzCmZf2wU15A3ZIYUPmnYLqsn4WmIV7rKmdqt2ctWELUXow3PPiZXBucP9P3xpsYEfF1SB2SGNc= u0_a139@localhost" | ||||
|       # Box | ||||
|       "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKN8/SH55DBiwVoSnTU8k2Pen+wmovL9QaMyehxGEsJJv/8fzwsswGalD4C/4O51LOvdu4UKkZW5hG02uVSK+58p3UV3pOPyoqsu/aDeIsWsqmTeTzUrBIWOlNzcDKnohLz2oGC5YO+wyTJ9Iteq6aGJDjErsW7sG3h5lXCs551EmJNNGhtBQaaoytMNnWqSdlVjDNCijurH7WUpp40U/RjEp532l4rX6eIIj3jBKEFbhZkFSSjqbj4xM4SyFt+Jmigb1RMjsQjmpfY1vDtM84RcYfpTUte/T5w2dkD5H6kccmWnwKSJpm9wXfx4E7lR9APdUGnau2U1+XxiD3ytGl anish@box" | ||||
|       # Work | ||||
|       "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/vvh0i6+uAN0GWlK6ZfyTlc/AW54xe2CroUDsDSoGnFKeIUiSsWexobODlVakNhqwCKfsvUh6g+RdA8ZVcamATcYqxysP4X5fRksmAzRm5281O7ZBDHMB2BdcfHSTgiz7JvMRIQYWDlU8Ck6IL4wlN0b2GMUj9t/GeG37us8280rxpRNoIY7M27AJEZ7XNQhctBIVujxctVBgIMYmZiTwziU7ywJv4rNT5OAWvjRXSo1rkxdvx3VESv4y/mp8m7dEupZpIjIFsLs52+UG5LtadulUqtTWg05sCw8LEcmRhflgZSAvjw60RrKFCuWxc8+/Pmaw+zExeBMenqi0NzuTc3S3k2wCKVIZDh/0tlXzIwZ6WRqxDevUtEKfvbEFMXd8akhTfYs0dyszcFRevBxOBPbcKku+FK/HkdPLmEANvxYty3cv+Eipkz3c8JPJPvXNTXrjepXMm0LUKodO3c15hGogCOxUO38kykkyYnn+MxxHparoMfEr2+oHNpQoS5wA1G43ppqjVoRDgnhleu6ixwRkLZzphY3cnOd5jL9Ie5xIGbFWH1qSlQRdHBkHjuf85z7+QK8nFYAhmG1K3Vt3GNtF8LN1tYQkfwBJ/vsroMNzGPoq4PjVbqb80Eq+96cP89XKfU2/xw1g+p2lJDm/zC1WCjXVzf8NRwC7gqPavQ== anishlakhwara@anishs-mbp.lan" | ||||
|     ]; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue