almost at parity now, can dog food
Needs: - surrond? - diagnostics icons - cmp still seems to shit the bed sometimes - lspsaga breadcrumbs on lualine - more which-key config!! - tests on svelte / web dev
This commit is contained in:
		
							parent
							
								
									0709b64a71
								
							
						
					
					
						commit
						10f6614348
					
				|  | @ -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}}) | ||||||
|  | @ -25,7 +25,6 @@ | ||||||
| (nvim.opt :signcolumn "yes") | (nvim.opt :signcolumn "yes") | ||||||
| (nvim.opt :cursorline true) | (nvim.opt :cursorline true) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| (nvim.opt :lisp true) ; include - in word to move better in snake-case) | (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.g :sexp_filetypes "clojure,scheme,lisp,janet,fennel,yuck") ; include the lisps I use | ||||||
| 
 | 
 | ||||||
|  | @ -36,5 +35,13 @@ | ||||||
| (require :conf.mappings) | (require :conf.mappings) | ||||||
| (require :conf.lsp) | (require :conf.lsp) | ||||||
| (require :conf.plugins.cmp) | (require :conf.plugins.cmp) | ||||||
| ; (require :conf.formatting) | (require :conf.formatting) | ||||||
| ; (require :conf.kitaab) | ; (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"}) | ||||||
|  |  | ||||||
|  | @ -1,10 +1,31 @@ | ||||||
| ; (local lspfuzzy (require :lspfuzzy)) | (import-macros {: do-req } :lib/macros) | ||||||
| (local lspkind (require :lspkind)) | (local lspkind (require :lspkind)) | ||||||
| (local lspconfig (require :lspconfig)) | (local lspconfig (require :lspconfig)) | ||||||
|  | (local lspsaga (require :lspsaga)) | ||||||
| (local cmp (require :cmp)) | (local cmp (require :cmp)) | ||||||
| (local nvim (require :lib/nvim)) | (local nvim (require :lib/nvim)) | ||||||
|  | ; (local lspfuzzy (require :lspfuzzy)) | ||||||
| ; (local sg (require :sg)) | ; (local sg (require :sg)) | ||||||
| ; (local lsputil (require :lspconfig/util)) | ; (local lsputil (require :lspconfig/util)) | ||||||
|  | ; (local navic (require :nvim-navic)) | ||||||
|  | 
 | ||||||
|  | (lspsaga.setup {:border_style "rounded" | ||||||
|  |                         :code_action_icon "" | ||||||
|  |                         :code_action_num_shortcut true | ||||||
|  |                         :code_action_lightbulb { | ||||||
|  |                             :enable false | ||||||
|  |                         } | ||||||
|  |                         ; show outline | ||||||
|  |                         :show_outline { | ||||||
|  |                           :win_position "right" | ||||||
|  |                           :auto_enter true | ||||||
|  |                           :auto_preview true | ||||||
|  |                           :virt_text "┃" | ||||||
|  |                           :jump_key "o" | ||||||
|  |                           ; auto refresh when change buffer | ||||||
|  |                           :auto_refresh  true | ||||||
|  |                         } | ||||||
|  |                       }) | ||||||
| 
 | 
 | ||||||
| (tset vim.lsp.handlers  | (tset vim.lsp.handlers  | ||||||
|       :textDocument/hover  |       :textDocument/hover  | ||||||
|  | @ -47,7 +68,7 @@ | ||||||
|   {:capabilities capabilities |   {:capabilities capabilities | ||||||
|    :codelens {:generate true :gc_details true} |    :codelens {:generate true :gc_details true} | ||||||
|    :semanticTokens true |    :semanticTokens true | ||||||
|    :flags { :debounce_text_changes 200} |    :flags {:debounce_text_changes 200} | ||||||
|    :analyses {:unusedparams true |    :analyses {:unusedparams true | ||||||
|               :unusedvariables true |               :unusedvariables true | ||||||
|               :unusedwrite true |               :unusedwrite true | ||||||
|  | @ -66,53 +87,14 @@ | ||||||
|            :rangeVariableTypes true} |            :rangeVariableTypes true} | ||||||
|    :on_attach on-attach}) |    :on_attach on-attach}) | ||||||
| 
 | 
 | ||||||
|  | (local lsps [:nil_ls :terraform_lsp :fennel_ls :tsserver]) | ||||||
|  | (each [index lsp (ipairs lsps)] | ||||||
|  |   ((. (. lspconfig lsp) :setup) {})) | ||||||
| 
 | 
 | ||||||
| ;  #    local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'lua_ls', 'nil_ls', 'gopls'} | ; null-ls | ||||||
| ;  #    for _, lsp in ipairs(servers) do | (let [null-ls (require :null-ls)] | ||||||
| ;  #      lspconfig[lsp].setup {} |   (null-ls.setup {:sources [;null-ls.builtins.diagnostics.shellcheck | ||||||
| ;  #        on_attach = function(client, bufnr) |                             null-ls.builtins.diagnostics.commitlint]})) | ||||||
| ;  #          format.on_attach(client) |                             ;null-ls.builtins.diagnostics.jsonlint]})) | ||||||
| ;  #          navic.attach(client, bufnr) |                             ;(null-ls.builtins.diagnostics.proselint.with {:filetypes ["vimwiki" "mail"]})]})) | ||||||
| ;  #        end, |  | ||||||
| ;  #        capabilities = capabilities, |  | ||||||
| ;  #       |  | ||||||
| ;  #    end) |  | ||||||
| ;; Diagnostics Config I don't yet understand |  | ||||||
| ; Set Diagnostics |  | ||||||
| ; local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } |  | ||||||
| ; for type, icon in pairs(signs) do |  | ||||||
| ; local hl = "DiagnosticSign" .. type |  | ||||||
| ; vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl}) |  | ||||||
| ; end |  | ||||||
| 
 | 
 | ||||||
| ; vim.g.diagnostics_active = true |  | ||||||
| ; function _G.toggle_diagnostics() |  | ||||||
| ;   if vim.g.diagnostics_active then |  | ||||||
| ;     vim.g.diagnostics_active = false |  | ||||||
| ;     vim.lsp.diagnostic.clear(0) |  | ||||||
| ;     vim.lsp.handlers["textDocument/publishDiagnostics"] = function() end |  | ||||||
| ;   else |  | ||||||
| ;     vim.g.diagnostics_active = true |  | ||||||
| ;     vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( |  | ||||||
| ;       vim.lsp.diagnostic.on_publish_diagnostics, { |  | ||||||
| ;         virtual_text = true, |  | ||||||
| ;         signs = true, |  | ||||||
| ;         underline = true, |  | ||||||
| ;         update_in_insert = false, |  | ||||||
| ;       } |  | ||||||
| ;     ) |  | ||||||
| ;   end |  | ||||||
| ; end |  | ||||||
| ; |  | ||||||
| ; vim.diagnostic.config({ |  | ||||||
| ;   signs = true, |  | ||||||
| ;   update_in_insert = false, |  | ||||||
| ;   underline = false, |  | ||||||
| ;   severity_sort = true, |  | ||||||
| ;   float = { |  | ||||||
| ;     focusable = false, |  | ||||||
| ;     style = 'minimal', |  | ||||||
| ;     border = 'rounded', |  | ||||||
| ;     source = 'always', |  | ||||||
| ;   }, |  | ||||||
| ; }) |  | ||||||
|  |  | ||||||
|  | @ -1,4 +1,6 @@ | ||||||
| (local nvim (require :lib/nvim)) | (local nvim (require :lib/nvim)) | ||||||
|  | (import-macros {: do-req } :lib/macros) | ||||||
|  | 
 | ||||||
| (local wk (require :which-key)) | (local wk (require :which-key)) | ||||||
| 
 | 
 | ||||||
| ;; Convenient way to indent stuff in visual mode | ;; Convenient way to indent stuff in visual mode | ||||||
|  | @ -30,8 +32,13 @@ | ||||||
| (nvim.keymap [:n] "gt" ":BufferNext<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] "gj" ":BufferPick<CR>" {:silent true :noremap true})  | ||||||
| (nvim.keymap [:n] "gb" ":Telescope buffers<CR>" {:silent true :noremap true})  | (nvim.keymap [:n] "gb" ":Telescope buffers<CR>" {:silent true :noremap true})  | ||||||
| (nvim.keymap [:n] "gq" ":BufferClosoe<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 | (local | ||||||
|   normal-map-leader |   normal-map-leader | ||||||
|  | @ -111,9 +118,10 @@ | ||||||
|             "Rename Symbol"] |             "Rename Symbol"] | ||||||
|         :h [":Lspsaga hover_doc<CR>" |         :h [":Lspsaga hover_doc<CR>" | ||||||
|             "Hover doc"] |             "Hover doc"] | ||||||
|         :o [":LSoutlineToggle<CR>" |         :o ["<cmd>AerialToggle!<CR>" | ||||||
|             "Outline"] |             "Outline"] | ||||||
|         :t [":call v:lua.toggle_diagnostics()<CR>"]} |         :t [":LspDiagnostics 0" | ||||||
|  |             "Find Errors in Buffer"]} | ||||||
|    ; Kitaab |    ; Kitaab | ||||||
|    "z" {:name "Kitaab" |    "z" {:name "Kitaab" | ||||||
|         :n [":ZettelNew<CR>" |         :n [":ZettelNew<CR>" | ||||||
|  |  | ||||||
|  | @ -2,3 +2,29 @@ | ||||||
| 
 | 
 | ||||||
| (nvim.g :tidal_target "terminal") | (nvim.g :tidal_target "terminal") | ||||||
| (nvim.g :scnvim_snippet_format "luasnip") | (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()) | ||||||
|  |  | ||||||
|  | @ -1,13 +1,14 @@ | ||||||
| (local nvim (require :lib/nvim)) | (local nvim (require :lib/nvim)) | ||||||
| 
 |  | ||||||
| (local navic (require :nvim-navic)) | (local navic (require :nvim-navic)) | ||||||
| 
 | 
 | ||||||
|  | (import-macros {: do-req } :lib/macros) | ||||||
|  | 
 | ||||||
| (let  [lualine (require :lualine)] | (let  [lualine (require :lualine)] | ||||||
|   (lualine.setup {:options {:theme "ayu"} |   (lualine.setup {:options {:theme "ayu"} | ||||||
|                   :sections {:lualine_c [:filename {1 navic.get_location  |                   :sections {:lualine_c [:filename {1 navic.get_location  | ||||||
|                                                     :cond navic.is_available}] |                                                     :cond navic.is_available}] | ||||||
|                              :lualine_y [(fn [] |                              :lualine_y [(fn [] | ||||||
|                                            ; TODO broken? |                                            ; TODO broken | ||||||
|                                              (let [msg "No Active Lsp" |                                              (let [msg "No Active Lsp" | ||||||
|                                                    buf_ft (vim.api.nvim_buf_get_option 0 "filetype") |                                                    buf_ft (vim.api.nvim_buf_get_option 0 "filetype") | ||||||
|                                                    clients (vim.lsp.get_active_clients)] |                                                    clients (vim.lsp.get_active_clients)] | ||||||
|  | @ -19,3 +20,25 @@ | ||||||
|                              :lualine_x [:filetype]}})) |                              :lualine_x [:filetype]}})) | ||||||
| 
 | 
 | ||||||
| (require :neo-tree) | (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) | ||||||
|  | ;TODO (do-req :mini.surround :setup) | ||||||
|  | (do-req :todo-comments :setup) | ||||||
|  | (do-req :ibl :setup) | ||||||
|  | 
 | ||||||
|  | (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})))}) | ||||||
|  |  | ||||||
|  | @ -11,47 +11,21 @@ | ||||||
|          (= (: (: cur-line :sub col col) :match "%s") |          (= (: (: cur-line :sub col col) :match "%s") | ||||||
|             nil)))) |             nil)))) | ||||||
| 
 | 
 | ||||||
| (fn tab [fallback] | (let [lspkind (require :lspkind)] | ||||||
|   (let [cmp (require :cmp) |   (cmp.setup {:formatting {:format lspkind.cmp_format | ||||||
|         luasnip (require :luasnip)] |                            :show_labelDetails true} | ||||||
|     (if (cmp.visible) |               ;:snippet {:expand (fn [args] | ||||||
|         (cmp.select_next_item) |               ;                    (let [luasnip (require :luasnip)] | ||||||
|         (let [available (luasnip.expand_or_jumpable)] |               ;                      (luasnip.lsp_expand args.body)) | ||||||
|           (if (= (available) true) |  | ||||||
|               (luasnip.expand_or_jump) |  | ||||||
|               (if (has-words-before) |  | ||||||
|                   (cmp.complete) |  | ||||||
|                   (fallback))))))) |  | ||||||
| 
 |  | ||||||
| (fn stab [fallback] |  | ||||||
|   (let [cmp (require :cmp) |  | ||||||
|         luasnip (require :luasnip)] |  | ||||||
|     (if (cmp.visible) |  | ||||||
|         (cmp.select_prev_item) |  | ||||||
|         (let [available (luasnip.jumpable -1)] |  | ||||||
|           (if (= (available) true) |  | ||||||
|               (luasnip.jump -1) |  | ||||||
|               (if (has-words-before) |  | ||||||
|                   (cmp.complete) |  | ||||||
|                   (fallback))))))) |  | ||||||
| 
 |  | ||||||
| (let [lspkind (require :lspkind) |  | ||||||
|       luasnip_loaders (require :luasnip.loaders.from_vscode)] |  | ||||||
|   (luasnip_loaders.lazy_load) |  | ||||||
|   (cmp.setup {:formatting {:format lspkind.cmp_format} |  | ||||||
|               :snippet {:expand (fn [args] |  | ||||||
|                                   (let [luasnip (require :luasnip)] |  | ||||||
|                                     (luasnip.lsp_expand args.body)))} |  | ||||||
|               :sources [{:name "buffer"}      {:name "nvim_lsp"}  |               :sources [{:name "buffer"}      {:name "nvim_lsp"}  | ||||||
|                         {:name "look"}        {:name "path"} |                         {:name "look"}        {:name "path"} | ||||||
|                         {:name "calc"}        {:name "spell"} |                         {:name "calc"}        {:name "spell"} | ||||||
|                         {:name "cmp-conjure"} {:name "luasnip"} |  | ||||||
|                         {:name "tags"}] |                         {:name "tags"}] | ||||||
|               :mapping {"<C-d>" (cmp.mapping.scroll_docs -4) |               :mapping {"<C-d>" (cmp.mapping.scroll_docs -4) | ||||||
|                         "<C-u>" (cmp.mapping.scroll_docs 4) |                         "<C-u>" (cmp.mapping.scroll_docs 4) | ||||||
|                         "<Up>" (cmp.mapping (cmp.mapping.select_prev_item) [:i :c]) |                         "<Up>" (cmp.mapping (cmp.mapping.select_prev_item) [:i :c]) | ||||||
|                         "<Down>" (cmp.mapping (cmp.mapping.select_next_item) [:i :c])  |                         "<Down>" (cmp.mapping (cmp.mapping.select_next_item) [:i :c])  | ||||||
|                         "<C-g>" (cmp.mapping.close) |                         "<C-g>" (cmp.mapping.close) | ||||||
|                         "<CR>" (cmp.mapping.confirm {:select true}) |                         "<CR>" (cmp.mapping.confirm {:select true})}})) | ||||||
|                         "<Tab>" (cmp.mapping tab [:i :s]) |                         ; "<Tab>" (cmp.mapping tab [:i :s]) | ||||||
|                         "<S-Tab>" (cmp.mapping stab [:i :s])}})) |                         ; "<S-Tab>" (cmp.mapping stab [:i :s])}})) | ||||||
|  |  | ||||||
|  | @ -1,5 +1,10 @@ | ||||||
|  | ; Kitaab is why I'm so tied to vim.  | ||||||
|  | ; If only I could find a nice notes editor...  | ||||||
|  | 
 | ||||||
| (local nvim (require :lib/nvim)) | (local nvim (require :lib/nvim)) | ||||||
| 
 | 
 | ||||||
|  | (import-macros {: do-req } :lib/macros) | ||||||
|  | 
 | ||||||
| (nvim.g :vimwiki_list [{:path "~/kitaab/vimwiki"  | (nvim.g :vimwiki_list [{:path "~/kitaab/vimwiki"  | ||||||
|                         :auto_tags 1  |                         :auto_tags 1  | ||||||
|                         :auto_diary_index 1  |                         :auto_diary_index 1  | ||||||
|  | @ -9,3 +14,22 @@ | ||||||
|                                           :nix "nix"  |                                           :nix "nix"  | ||||||
|                                           :bash "sh"}}]) |                                           :bash "sh"}}]) | ||||||
| (nvim.g :zettel_format "%y%m%d-%H%M") | (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} | ||||||
|  | @ -22,6 +22,7 @@ | ||||||
| { | { | ||||||
|   home.sessionVariables.EDITOR = "nvim"; |   home.sessionVariables.EDITOR = "nvim"; | ||||||
|   home.shellAliases = { |   home.shellAliases = { | ||||||
|  |     vim = "nvim"; | ||||||
|     k = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex; cd $OLDPWD"; |     k = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex; cd $OLDPWD"; | ||||||
|     # kitaab zettel |     # kitaab zettel | ||||||
|     kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD"; |     kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD"; | ||||||
|  | @ -48,7 +49,6 @@ | ||||||
|   #    filetype plugin on |   #    filetype plugin on | ||||||
| 
 | 
 | ||||||
|   #    set shortmess+=c |   #    set shortmess+=c | ||||||
|   #    " always show signcolumns |  | ||||||
| 
 | 
 | ||||||
|   #    " Pasting  |   #    " Pasting  | ||||||
|   #    :map <leader>sy :!xclip -i<CR><CR> |   #    :map <leader>sy :!xclip -i<CR><CR> | ||||||
|  | @ -59,22 +59,8 @@ | ||||||
|   #    lua <<EOF |   #    lua <<EOF | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   #    local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview |  | ||||||
|   #    function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) |  | ||||||
|   #      opts = opts or {} |  | ||||||
|   #      opts.border = opts.border or 'rounded' |  | ||||||
|   #      return orig_util_open_floating_preview(contents, syntax, opts, ...) |  | ||||||
|   #    end |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   #    -- autopairs |  | ||||||
|   #    require('nvim-autopairs').setup{} |  | ||||||
| 
 |  | ||||||
|   #    -- marks |  | ||||||
|   #    require('marks').setup{} |  | ||||||
| 
 |  | ||||||
|   #    -- Setup nvim-cmp. |  | ||||||
| 
 |  | ||||||
|   #    local luasnip = require("luasnip") |   #    local luasnip = require("luasnip") | ||||||
|   #    local lspkind = require("lspkind") |   #    local lspkind = require("lspkind") | ||||||
|   #    local t = function(str) |   #    local t = function(str) | ||||||
|  | @ -85,26 +71,9 @@ | ||||||
|   #        return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil |   #        return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil | ||||||
|   #    end |   #    end | ||||||
| 
 | 
 | ||||||
|   #    -- null-ls |  | ||||||
|   #    -- being very janky |  | ||||||
|   #    local null_ls = require("null-ls") |  | ||||||
|   #    null_ls.setup({ |  | ||||||
|   #      sources = { |  | ||||||
|   #        null_ls.builtins.diagnostics.shellcheck, |  | ||||||
|   #        null_ls.builtins.diagnostics.proselint.with({ filetypes = { "vimwiki", "mail", }, }), |  | ||||||
|   #        null_ls.builtins.diagnostics.commitlint, |  | ||||||
|   #        null_ls.builtins.diagnostics.jsonlint, |  | ||||||
|   #    --     null_ls.builtins.code_actions.statix, |  | ||||||
|   #    --     null_ls.builtins.diagnostics.clj_kondo, |  | ||||||
|   #    --     null_ls.builtins.formatting.isort, |  | ||||||
|   #    --     null_ls.builtins.formatting.black, |  | ||||||
|   #      }, |  | ||||||
|   #    }) |  | ||||||
| 
 | 
 | ||||||
|   #    -- Setup lspconfig |   #    -- Setup lspconfig | ||||||
|   #    require("lsp-format").setup {} |  | ||||||
|   #    require("nvim-navic").setup {} |   #    require("nvim-navic").setup {} | ||||||
|   #    local format = require("lsp-format") |  | ||||||
|   #    local navic = require("nvim-navic") |   #    local navic = require("nvim-navic") | ||||||
| 
 | 
 | ||||||
|   #    -- lspsaga, code_action lightbulb is annoying |   #    -- lspsaga, code_action lightbulb is annoying | ||||||
|  | @ -140,19 +109,6 @@ | ||||||
|   #      }, |   #      }, | ||||||
|   #    }) |   #    }) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|   #    -- fennel-ls is bleeding edge |  | ||||||
|   #    local lspconfig = require('lspconfig') |  | ||||||
|   #    require("lspconfig.configs")["fennel-ls"] = { |  | ||||||
|   #      default_config = { |  | ||||||
|   #        cmd = {"fennel-ls"}, |  | ||||||
|   #        filetypes = {"fennel"}, |  | ||||||
|   #        root_dir = function(dir) return lspconfig.util.find_git_ancestor(dir) end, |  | ||||||
|   #        settings = {} |  | ||||||
|   #      } |  | ||||||
|   #    } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   #    -- fennel-ls doesn't support gps |   #    -- fennel-ls doesn't support gps | ||||||
|   #    lspconfig['fennel-ls'].setup { |   #    lspconfig['fennel-ls'].setup { | ||||||
|   #      on_attach = function(client, bufnr) |   #      on_attach = function(client, bufnr) | ||||||
|  | @ -186,17 +142,6 @@ | ||||||
|   #    --   }, |   #    --   }, | ||||||
|   #    -- } |   #    -- } | ||||||
| 
 | 
 | ||||||
|   #    require('gitsigns').setup { sign_priority=80 } |  | ||||||
| 
 |  | ||||||
|   #    -- treesitter |  | ||||||
|   #    require('nvim-treesitter.configs').setup {  |  | ||||||
|   #      -- parser_install_dir = "~/.local/share/nvim/site/parser/", |  | ||||||
|   #      -- ensure_installed={'nix', 'clojure', 'python', 'fennel', 'lua', 'html', 'css', 'regex', 'supercollider', 'beancount', 'janet'}, |  | ||||||
|   #      highlight = { enabled = true, additional_vim_regex_highting = true, }, |  | ||||||
|   #      textobjects = { enabled = true }, |  | ||||||
|   #    } |  | ||||||
|   #    -- 'glsl' needs c++ compiler lol |  | ||||||
| 
 |  | ||||||
|   #    -- lualine |   #    -- lualine | ||||||
|   #    local navic = require("nvim-navic") |   #    local navic = require("nvim-navic") | ||||||
|   #    require('lualine').setup { |   #    require('lualine').setup { | ||||||
|  | @ -226,81 +171,6 @@ | ||||||
|   #      } |   #      } | ||||||
|   #    } |   #    } | ||||||
| 
 | 
 | ||||||
|   #    -- nvim-lint |  | ||||||
|   #    -- require('lint').linters_by_ft = { |  | ||||||
|   #    --   markdown = {'vale'}, |  | ||||||
|   #    -- } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   #    -- Custom functions |  | ||||||
|   #    function update_date() |  | ||||||
|   #      local time = os.date("%Y-%m-%d %H:%M") |  | ||||||
|   #      local message = "%update " .. time |  | ||||||
|   #      local lines = vim.api.nvim_buf_get_lines(0, 0,4,false) |  | ||||||
|   #      for i=1,4,1 do |  | ||||||
|   #        if (lines[i]:len() == 0) then |  | ||||||
|   #          vim.api.nvim_buf_set_lines(0, i-1, i, false, {message, ""}) |  | ||||||
|   #          return |  | ||||||
|   #        end |  | ||||||
|   #      end |  | ||||||
|   #      if (lines[4]:len() ~= 0) then |  | ||||||
|   #        vim.api.nvim_buf_set_lines(0, 3, 4, false, {message}) |  | ||||||
|   #      end |  | ||||||
|   #      return |  | ||||||
|   #    end |  | ||||||
| 
 |  | ||||||
|   #    vim.api.nvim_create_autocmd( |  | ||||||
|   #      "BufWritePre",  |  | ||||||
|   #      { pattern = { "*.wiki" }, callback = update_date} |  | ||||||
|   #    ) |  | ||||||
| 
 |  | ||||||
|   #    -- set spelling for text files |  | ||||||
|   #    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" } |  | ||||||
|   #    ) |  | ||||||
| 
 |  | ||||||
|   #    -- auto session |  | ||||||
|   #    require('auto-session').setup { |  | ||||||
|   #      log_level = 'info', |  | ||||||
|   #      auto_session_suppress_dirs = {'~/'} |  | ||||||
|   #    } |  | ||||||
|   #    vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal" |  | ||||||
| 
 |  | ||||||
|   #    require("which-key").setup{} |  | ||||||
|   #    require('leap').set_default_keymaps() |  | ||||||
|   #     |  | ||||||
|   #    -- 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()) |  | ||||||
| 
 | 
 | ||||||
|   #    -- zen mode |   #    -- zen mode | ||||||
|   #    require('zen-mode').setup{ |   #    require('zen-mode').setup{ | ||||||
|  | @ -347,10 +217,6 @@ | ||||||
|   #    } |   #    } | ||||||
|   #    require('twilight').setup{} |   #    require('twilight').setup{} | ||||||
| 
 | 
 | ||||||
|   #    -- hologram |  | ||||||
|   #    require('hologram').setup{ |  | ||||||
|   #        auto_display = false -- WIP automatic markdown image display, may be prone to breaking |  | ||||||
|   #    } |  | ||||||
| 
 | 
 | ||||||
|   #    EOF |   #    EOF | ||||||
| 
 | 
 | ||||||
|  | @ -358,19 +224,20 @@ | ||||||
|     extraPackages = with pkgs;  [ |     extraPackages = with pkgs;  [ | ||||||
|       # used to compile tree-sitter grammar |       # used to compile tree-sitter grammar | ||||||
|       # python-with-my-packages |       # python-with-my-packages | ||||||
|       nodejs |       # nodejs | ||||||
|       clojure-lsp |       # clojure-lsp | ||||||
|       clojure |       # clojure | ||||||
|       clj-kondo |       # clj-kondo | ||||||
|       terraform-lsp |       terraform-lsp | ||||||
|  |       nil | ||||||
|       gopls |       gopls | ||||||
|       gcc |       gcc | ||||||
|       shellcheck |       shellcheck | ||||||
|       proselint |       proselint | ||||||
|       statix |       # statix | ||||||
|       nodePackages.typescript |       # nodePackages.typescript | ||||||
|       nodePackages.typescript-language-server |       # nodePackages.typescript-language-server | ||||||
|       luajitPackages.lua-lsp |       # luajitPackages.lua-lsp | ||||||
|       fennel-ls |       fennel-ls | ||||||
|       # starpls-bin # TODO find this!! |       # starpls-bin # TODO find this!! | ||||||
|     ]; |     ]; | ||||||
|  | @ -386,33 +253,32 @@ | ||||||
|       nvim-web-devicons |       nvim-web-devicons | ||||||
|       telescope-nvim |       telescope-nvim | ||||||
|       plenary-nvim |       plenary-nvim | ||||||
|       nvim-navic |  | ||||||
|       FTerm-nvim |       FTerm-nvim | ||||||
|       barbar-nvim |       barbar-nvim | ||||||
| 
 |  | ||||||
|       # TODO |  | ||||||
|       # neotree |  | ||||||
|       neovim-ayu |       neovim-ayu | ||||||
|       rainbow_parentheses-vim |       rainbow_parentheses-vim | ||||||
|       vim-surround |  | ||||||
|       undotree |  | ||||||
| 
 |  | ||||||
|       (nvim-treesitter.withPlugins (p: [ p.nix p.clojure p.fennel p.lua p.html p.css p.regex p.supercollider p.beancount p.markdown p.glsl p.yaml p.toml p.dockerfile p.json ])) |  | ||||||
|       nvim-treesitter-context |  | ||||||
|       auto-session |       auto-session | ||||||
|       which-key-nvim |       which-key-nvim | ||||||
|       zen-mode-nvim |       aerial-nvim | ||||||
|       twilight-nvim |       todo-comments-nvim | ||||||
|        |       indent-blankline-nvim | ||||||
|       # TODO remove? | 
 | ||||||
|       vim-dasht |       # Tree sitter | ||||||
|  |       (nvim-treesitter.withPlugins (p: [ p.nix p.clojure p.fennel p.lua p.html p.css p.regex p.supercollider p.beancount p.markdown_inline p.markdown p.glsl p.yaml p.toml p.dockerfile p.json p.go ])) | ||||||
|  |       nvim-treesitter-context | ||||||
|  |       nvim-treesitter-textobjects | ||||||
|  | 
 | ||||||
|  |       # TODO | ||||||
|  |       nvim-navic | ||||||
|  |       undotree | ||||||
|  |       marks-nvim | ||||||
| 
 | 
 | ||||||
|       # language |       # language | ||||||
|       vim-nix |       vim-nix | ||||||
|       emmet-vim |       emmet-vim | ||||||
|       csv-vim |       csv-vim | ||||||
|       direnv-vim |       direnv-vim | ||||||
|       conjure |       # conjure | ||||||
| 
 | 
 | ||||||
|       # kitaab stuff |       # kitaab stuff | ||||||
|       vimwiki |       vimwiki | ||||||
|  | @ -420,24 +286,20 @@ | ||||||
|       hologram-nvim |       hologram-nvim | ||||||
| 
 | 
 | ||||||
|       # lsp stuff |       # lsp stuff | ||||||
|       # nvim-lint |  | ||||||
|       null-ls-nvim |  | ||||||
|       nvim-lspconfig |       nvim-lspconfig | ||||||
|       nvim-cmp |       nvim-cmp | ||||||
|       cmp-nvim-lsp |       cmp-nvim-lsp | ||||||
|       cmp-treesitter |       cmp-treesitter | ||||||
|       nvim-lsp-ts-utils |       # cmp-conjure | ||||||
|       lspsaga-nvim |  | ||||||
|       cmp-conjure |  | ||||||
|       cmp-buffer |       cmp-buffer | ||||||
|       cmp-path |       cmp-path | ||||||
|       cmp-spell |       cmp-spell | ||||||
|       nvim-autopairs |  | ||||||
|       cmp_luasnip |  | ||||||
|       luasnip |  | ||||||
|       lsp-format-nvim |  | ||||||
|       friendly-snippets |  | ||||||
|       lspkind-nvim |       lspkind-nvim | ||||||
|  |       conform-nvim | ||||||
|  |       none-ls-nvim | ||||||
|  |       mini-nvim | ||||||
|  |       lspsaga-nvim | ||||||
|  |       # nvim-lspfuzzy | ||||||
| 
 | 
 | ||||||
|       # git stuff |       # git stuff | ||||||
|       vim-fugitive |       vim-fugitive | ||||||
|  | @ -454,7 +316,7 @@ | ||||||
|       # experimental  |       # experimental  | ||||||
|       nvim-luapad |       nvim-luapad | ||||||
|       scnvim |       scnvim | ||||||
|       leap-nvim |       flash-nvim | ||||||
|       vim-beancount |       vim-beancount | ||||||
|       # vimtex |       # vimtex | ||||||
|       # custom |       # custom | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue