it's finished now 😌

This commit is contained in:
Anish Lakhwara 2024-08-27 19:18:33 -07:00
parent 17e51c791d
commit ac06734c3b
5 changed files with 199 additions and 196 deletions

View 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

View file

@ -7,31 +7,29 @@
; (local lspfuzzy (require :lspfuzzy)) ; Not available on Nix
; (local sg (require :sg))
; (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
}
})
:code_action_lightbulb { :enable false}
:show_outline { :enable false}})
(nvim.opt :winbar "%f")
(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

View file

@ -5,29 +5,30 @@
(let [lualine (require :lualine)]
(lualine.setup {:options {:theme "ayu"}
:sections {:lualine_c [:filename {1 navic.get_location
:cond navic.is_available}]
:sections {:lualine_c [:filename (fn []
(let [lspsaga (require :lspsaga.symbol.winbar)]
(lspsaga.get_bar)))]
:lualine_y [(fn []
; TODO broken
(let [msg "No Active Lsp"
buf_ft (vim.api.nvim_buf_get_option 0 "filetype")
(var msg "No Active LSP")
(let [buf_ft (vim.api.nvim_buf_get_option 0 "filetype")
clients (vim.lsp.get_active_clients)]
(if (= (next clients) nil) msg)
(each [_ client (ipairs clients)]
(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))]
:lualine_x [:filetype]}}))
(require :neo-tree)
(do-req :gitsigns :setup)
(do-req :marks :setup)
(do-req :mini.pairs :setup)
; (do-req :mini.pairs :setup)
(do-req :mini.diff :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 :ibl :setup)
(do-req :ibl :setup {:exclude {:language ["fennel" "clojure" "janet"]}})
(do-req :nvim-treesitter.configs :setup {:highlight {:enable true}
:textobjects {:enable true}
@ -38,7 +39,7 @@
: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})))})
(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}))

View file

@ -12,20 +12,24 @@
nil))))
(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}
;:snippet {:expand (fn [args]
; (let [luasnip (require :luasnip)]
; (luasnip.lsp_expand args.body))
: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)
"<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)
"<CR>" (cmp.mapping.confirm {:select true})}}))
; "<Tab>" (cmp.mapping tab [:i :s])
; "<S-Tab>" (cmp.mapping stab [:i :s])}}))
"<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])}}))

View file

@ -9,19 +9,11 @@
# kitaab zettel
kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD";
# 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 = {
# 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;
};
home.file.".config/nvim".source = ./config;
#environment.systemPackages = with customPlugins; [ tidal ];
programs.neovim = {
@ -37,19 +29,7 @@
# :map <leader>sp :r!xclip -o<CR>
# " 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
# require('zen-mode').setup{
# window = {
@ -109,6 +89,7 @@
gopls
gcc
shellcheck
shfmt
proselint
nixfmt
# statix
@ -119,9 +100,11 @@
unstable.starpls-bin
];
plugins = with pkgs.vimPlugins; [
plugins = with pkgs.unstable.vimPlugins;
[
#hotpot
hotpot-nvim
nvim-navic
# ui
lualine-nvim
neo-tree-nvim
@ -139,14 +122,33 @@
aerial-nvim
todo-comments-nvim
indent-blankline-nvim
nvim-parinfer
# 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-textobjects
# TODO
nvim-navic
undotree
marks-nvim
@ -189,17 +191,11 @@
vim-sexp-mappings-for-regular-people
fennel-vim
vim-tidal
# experimental
nvim-luapad
# nvim-luapad
scnvim
flash-nvim
vim-beancount
# vimtex
# custom
# nvim-parinfer
# vim-processing
];
] ++ [ pkgs.vimPlugins.vim-tidal ];
# withPython3 = true;
# extraPython3Packages = pkgs: with pkgs; [ tasklib six ];
# vimAlias = true;