it's finished now 😌
This commit is contained in:
		
							parent
							
								
									17e51c791d
								
							
						
					
					
						commit
						ac06734c3b
					
				
							
								
								
									
										4
									
								
								home/profiles/nvim/config/fnl/after/syntax/vimwiki.vim
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								home/profiles/nvim/config/fnl/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 | ||||||
|  | @ -7,31 +7,29 @@ | ||||||
| ; (local lspfuzzy (require :lspfuzzy)) ; Not available on Nix | ; (local lspfuzzy (require :lspfuzzy)) ; Not available on Nix | ||||||
| ; (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" | (lspsaga.setup {:border_style "rounded" | ||||||
|                 :code_action_icon "" |                 :code_action_icon "" | ||||||
|                 :code_action_num_shortcut true |                 :code_action_num_shortcut true | ||||||
|                         :code_action_lightbulb { |                 :code_action_lightbulb { :enable false} | ||||||
|                             :enable false |                 :show_outline { :enable false}}) | ||||||
|                         } | 
 | ||||||
|                         ; show outline | (nvim.opt :winbar "%f") | ||||||
|                         :show_outline { | 
 | ||||||
|                           :win_position "right" | (local signs {:Error " "  | ||||||
|                           :auto_enter true |               :Warn " "  | ||||||
|                           :auto_preview true |               :Hint " "  | ||||||
|                           :virt_text "┃" |               :Info " "}) | ||||||
|                           :jump_key "o" | (each [t icon (pairs signs)] | ||||||
|                           ; auto refresh when change buffer |   (let [hl (.. "DiagnosticSign" t)] | ||||||
|                           :auto_refresh  true |     (vim.fn.sign_define hl {:text icon | ||||||
|                         } |                             :texthl hl | ||||||
|                       }) |                             :numhl hl}))) | ||||||
| 
 | 
 | ||||||
| (tset vim.lsp.handlers  | (tset vim.lsp.handlers  | ||||||
|       :textDocument/hover  |       :textDocument/hover  | ||||||
|       (vim.lsp.with vim.lsp.handlers.hover  |       (vim.lsp.with vim.lsp.handlers.hover  | ||||||
|                     {:focusable false :border "rounded"})) |                     {:focusable false :border "rounded"})) | ||||||
| 
 |  | ||||||
| (tset vim.lsp.handlers | (tset vim.lsp.handlers | ||||||
|       :textDocument/signatureHelp |       :textDocument/signatureHelp | ||||||
|       (vim.lsp.with vim.lsp.handlers.signature_help |       (vim.lsp.with vim.lsp.handlers.signature_help | ||||||
|  |  | ||||||
|  | @ -5,29 +5,30 @@ | ||||||
| 
 | 
 | ||||||
| (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 (fn [] | ||||||
|                                                     :cond navic.is_available}] |                                                      (let [lspsaga (require :lspsaga.symbol.winbar)] | ||||||
|  |                                                        (lspsaga.get_bar)))] | ||||||
|                              :lualine_y [(fn [] |                              :lualine_y [(fn [] | ||||||
|                                            ; TODO broken |                                            (var msg "No Active LSP") | ||||||
|                                              (let [msg "No Active Lsp" |                                            (let [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)] | ||||||
|                                                (if (= (next clients) nil) msg) |  | ||||||
|                                              (each [_ client (ipairs clients)] |                                              (each [_ client (ipairs clients)] | ||||||
|                                                (let [filetypes (. client :config :filetypes)] |                                                (let [filetypes (. client :config :filetypes)] | ||||||
|                                                    (if (and filetypes (vim.fn.index filetypes buf_ft)) client.name))) |                                                  (if (and filetypes (vim.fn.index filetypes buf_ft)) (set msg client.name)))) | ||||||
|                                              msg))] |                                              msg))] | ||||||
|                              :lualine_x [:filetype]}})) |                              :lualine_x [:filetype]}})) | ||||||
| 
 | 
 | ||||||
| (require :neo-tree) | (require :neo-tree) | ||||||
| (do-req :gitsigns :setup) | (do-req :gitsigns :setup) | ||||||
| (do-req :marks :setup) | (do-req :marks :setup) | ||||||
| (do-req :mini.pairs :setup) | ; (do-req :mini.pairs :setup) | ||||||
| (do-req :mini.diff :setup) | (do-req :mini.diff :setup) | ||||||
| (do-req :mini.ai :setup) | (do-req :mini.ai :setup) | ||||||
| ;TODO (do-req :mini.surround :setup) | (do-req :mini.surround :setup {:mappings {:add "ys" | ||||||
|  |                                           :delete "ds" | ||||||
|  |                                           :replace "cs"}}) | ||||||
| (do-req :todo-comments :setup) | (do-req :todo-comments :setup) | ||||||
| (do-req :ibl :setup) | (do-req :ibl :setup {:exclude {:language ["fennel" "clojure" "janet"]}}) | ||||||
| 
 | 
 | ||||||
| (do-req :nvim-treesitter.configs :setup {:highlight {:enable true} | (do-req :nvim-treesitter.configs :setup {:highlight {:enable true} | ||||||
|                                          :textobjects {:enable true} |                                          :textobjects {:enable true} | ||||||
|  | @ -38,7 +39,7 @@ | ||||||
|                               :auto_session_suppress_dirs ["~/"]}) |                               :auto_session_suppress_dirs ["~/"]}) | ||||||
| (nvim.opt :sessionoptions "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal") | (nvim.opt :sessionoptions "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal") | ||||||
| 
 | 
 | ||||||
| (do-req :aerial :setup {:on_attach (fn [bufnr]  | (do-req :aerial :setup {}) ;{:on_attach (fn [bufnr]  | ||||||
|                                      (do  |                        ;              (do  | ||||||
|                                        (vim.keymap.set "n" "{" "<cmd>AerialPrev<CR>" { :buffer bufnr}) |                        ;                (vim.keymap.set "n" "{" "<cmd>AerialPrev<CR>" { :buffer bufnr}) | ||||||
|                                        (vim.keymap.set "n" "}" "<cmd>AerialNext<CR>" { :buffer bufnr})))}) |                        ;                (vim.keymap.set "n" "}" "<cmd>AerialNext<CR>" { :buffer bufnr})) | ||||||
|  |  | ||||||
|  | @ -12,20 +12,24 @@ | ||||||
|             nil)))) |             nil)))) | ||||||
| 
 | 
 | ||||||
| (let [lspkind (require :lspkind)] | (let [lspkind (require :lspkind)] | ||||||
|   (cmp.setup {:formatting {:format lspkind.cmp_format |   (cmp.setup {:formatting {:format (lspkind.cmp_format {:mode "symbol_text" | ||||||
|  |                                                         :maxwidth 50}) | ||||||
|                            :show_labelDetails true} |                            :show_labelDetails true} | ||||||
|               ;:snippet {:expand (fn [args] |               :snippet {:expand (fn [args] (vim.snippet.expand args.body))} | ||||||
|               ;                    (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 "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]) |  | ||||||
|                         "<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 (fn [fallback] | ||||||
|                         ; "<S-Tab>" (cmp.mapping stab [:i :s])}})) |                                                (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])}})) | ||||||
|  |  | ||||||
|  | @ -9,19 +9,11 @@ | ||||||
|     # 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"; | ||||||
|     # kitaab get by tagged |     # kitaab get by tagged | ||||||
|     kt = "cd /home/anish/kitaab/vimwiki; eza *_index.wiki | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD"; |     kt = | ||||||
|  |       "cd /home/anish/kitaab/vimwiki; eza *_index.wiki | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD"; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   home.file = { |   home.file.".config/nvim".source = ./config; | ||||||
|     # Add %update to the highlight clause for vimwiki files |  | ||||||
|    # ".config/nvim/after/syntax/vimwiki.vim".text = '' |  | ||||||
|    #   " 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 |  | ||||||
|    # ''; |  | ||||||
|    ".config/nvim".source = ./config; |  | ||||||
|   }; |  | ||||||
| 
 | 
 | ||||||
|   #environment.systemPackages = with customPlugins; [ tidal ]; |   #environment.systemPackages = with customPlugins; [ tidal ]; | ||||||
|   programs.neovim = { |   programs.neovim = { | ||||||
|  | @ -37,19 +29,7 @@ | ||||||
|     #    :map <leader>sp :r!xclip -o<CR> |     #    :map <leader>sp :r!xclip -o<CR> | ||||||
| 
 | 
 | ||||||
|     #    " lua config  |     #    " lua config  | ||||||
|   #    lua <<EOF |  | ||||||
|   #    local luasnip = require("luasnip") |  | ||||||
|   #    local lspkind = require("lspkind") |  | ||||||
|   #    local t = function(str) |  | ||||||
|   #        return vim.api.nvim_replace_termcodes(str, true, true, true) |  | ||||||
|   #    end |  | ||||||
|   #    local check_back_space = function() |  | ||||||
|   #        local col = vim.fn.col(".") - 1 |  | ||||||
|   #        return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil |  | ||||||
|   #    end |  | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|   #    -- Setup lspconfig |  | ||||||
|     #    -- zen mode |     #    -- zen mode | ||||||
|     #    require('zen-mode').setup{ |     #    require('zen-mode').setup{ | ||||||
|     #      window = { |     #      window = { | ||||||
|  | @ -109,6 +89,7 @@ | ||||||
|       gopls |       gopls | ||||||
|       gcc |       gcc | ||||||
|       shellcheck |       shellcheck | ||||||
|  |       shfmt | ||||||
|       proselint |       proselint | ||||||
|       nixfmt |       nixfmt | ||||||
|       # statix |       # statix | ||||||
|  | @ -119,9 +100,11 @@ | ||||||
|       unstable.starpls-bin |       unstable.starpls-bin | ||||||
|     ]; |     ]; | ||||||
| 
 | 
 | ||||||
|     plugins = with pkgs.vimPlugins; [ |     plugins = with pkgs.unstable.vimPlugins; | ||||||
|  |       [ | ||||||
|         #hotpot |         #hotpot | ||||||
|         hotpot-nvim |         hotpot-nvim | ||||||
|  |         nvim-navic | ||||||
|         # ui |         # ui | ||||||
|         lualine-nvim |         lualine-nvim | ||||||
|         neo-tree-nvim |         neo-tree-nvim | ||||||
|  | @ -139,14 +122,33 @@ | ||||||
|         aerial-nvim |         aerial-nvim | ||||||
|         todo-comments-nvim |         todo-comments-nvim | ||||||
|         indent-blankline-nvim |         indent-blankline-nvim | ||||||
|  |         nvim-parinfer | ||||||
| 
 | 
 | ||||||
|         # Tree sitter |         # 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 p.starlark ])) |         (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 | ||||||
|  |           p.starlark | ||||||
|  |         ])) | ||||||
|         nvim-treesitter-context |         nvim-treesitter-context | ||||||
|         nvim-treesitter-textobjects |         nvim-treesitter-textobjects | ||||||
| 
 | 
 | ||||||
|         # TODO |         # TODO | ||||||
|       nvim-navic |  | ||||||
|         undotree |         undotree | ||||||
|         marks-nvim |         marks-nvim | ||||||
| 
 | 
 | ||||||
|  | @ -189,17 +191,11 @@ | ||||||
|         vim-sexp-mappings-for-regular-people |         vim-sexp-mappings-for-regular-people | ||||||
|         fennel-vim |         fennel-vim | ||||||
| 
 | 
 | ||||||
|       vim-tidal |         # nvim-luapad | ||||||
|       # experimental  |  | ||||||
|       nvim-luapad |  | ||||||
|         scnvim |         scnvim | ||||||
|         flash-nvim |         flash-nvim | ||||||
|         vim-beancount |         vim-beancount | ||||||
|       # vimtex |       ] ++ [ pkgs.vimPlugins.vim-tidal ]; | ||||||
|       # custom |  | ||||||
|       # nvim-parinfer |  | ||||||
|       # vim-processing |  | ||||||
|     ]; |  | ||||||
|     # withPython3 = true; |     # withPython3 = true; | ||||||
|     # extraPython3Packages = pkgs: with pkgs; [ tasklib six ]; |     # extraPython3Packages = pkgs: with pkgs; [ tasklib six ]; | ||||||
|     # vimAlias = true; |     # vimAlias = true; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue