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 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

View file

@ -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)] (each [_ client (ipairs clients)]
(if (= (next clients) nil) msg) (let [filetypes (. client :config :filetypes)]
(each [_ client (ipairs clients)] (if (and filetypes (vim.fn.index filetypes buf_ft)) (set msg client.name))))
(let [filetypes (. client :config :filetypes)] msg))]
(if (and filetypes (vim.fn.index filetypes buf_ft)) client.name)))
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}))

View file

@ -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])}}))

View file

@ -9,95 +9,75 @@
# 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 = {
enable = true; enable = true;
# extraConfig = '' # extraConfig = ''
# filetype plugin on # filetype plugin on
# set shortmess+=c # set shortmess+=c
# " Pasting # " Pasting
# :map <leader>sy :!xclip -i<CR><CR> # :map <leader>sy :!xclip -i<CR><CR>
# :vmap <leader>sy "*y # :vmap <leader>sy "*y
# :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
# -- zen mode
# require('zen-mode').setup{
# window = {
# backdrop = 1.0, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
# -- height and width can be:
# -- * an absolute number of cells when > 1
# -- * a percentage of the width / height of the editor when <= 1
# -- * a function that returns the width or the height
# width = 120, -- width of the Zen window
# height = 1, -- height of the Zen window
# -- by default, no options are changed for the Zen window
# -- uncomment any of the options below, or add other vim.wo options you want to apply
# options = {
# signcolumn = "no", -- disable signcolumn
# number = false, -- disable number column
# relativenumber = false, -- disable relative numbers
# cursorline = false, -- disable cursorline
# cursorcolumn = false, -- disable cursor column
# foldcolumn = "0", -- disable fold column
# list = false, -- disable whitespace characters
# },
# },
# plugins = {
# -- disable some global vim options (vim.o...)
# -- comment the lines to not apply the options
# options = {
# enabled = true,
# ruler = false, -- disables the ruler text in the cmd line area
# showcmd = false, -- disables the command in the last line of the screen
# },
# twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
# gitsigns = { enabled = false }, -- disables git signs
# tmux = { enabled = false }, -- disables the tmux statusline
# -- this will change the font size on kitty when in zen mode
# -- to make this work, you need to set the following kitty options:
# -- - allow_remote_control socket-only
# -- - listen_on unix:/tmp/kitty
# kitty = {
# enabled = true,
# font = "+2", -- font size increment
# },
# },
# }
# require('twilight').setup{}
# EOF
# '';
# -- Setup lspconfig extraPackages = with pkgs; [
# -- zen mode
# require('zen-mode').setup{
# window = {
# backdrop = 1.0, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
# -- height and width can be:
# -- * an absolute number of cells when > 1
# -- * a percentage of the width / height of the editor when <= 1
# -- * a function that returns the width or the height
# width = 120, -- width of the Zen window
# height = 1, -- height of the Zen window
# -- by default, no options are changed for the Zen window
# -- uncomment any of the options below, or add other vim.wo options you want to apply
# options = {
# signcolumn = "no", -- disable signcolumn
# number = false, -- disable number column
# relativenumber = false, -- disable relative numbers
# cursorline = false, -- disable cursorline
# cursorcolumn = false, -- disable cursor column
# foldcolumn = "0", -- disable fold column
# list = false, -- disable whitespace characters
# },
# },
# plugins = {
# -- disable some global vim options (vim.o...)
# -- comment the lines to not apply the options
# options = {
# enabled = true,
# ruler = false, -- disables the ruler text in the cmd line area
# showcmd = false, -- disables the command in the last line of the screen
# },
# twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
# gitsigns = { enabled = false }, -- disables git signs
# tmux = { enabled = false }, -- disables the tmux statusline
# -- this will change the font size on kitty when in zen mode
# -- to make this work, you need to set the following kitty options:
# -- - allow_remote_control socket-only
# -- - listen_on unix:/tmp/kitty
# kitty = {
# enabled = true,
# font = "+2", -- font size increment
# },
# },
# }
# require('twilight').setup{}
# EOF
# '';
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
@ -109,6 +89,7 @@
gopls gopls
gcc gcc
shellcheck shellcheck
shfmt
proselint proselint
nixfmt nixfmt
# statix # statix
@ -116,90 +97,105 @@
# nodePackages.typescript-language-server # nodePackages.typescript-language-server
# luajitPackages.lua-lsp # luajitPackages.lua-lsp
fennel-ls fennel-ls
unstable.starpls-bin unstable.starpls-bin
]; ];
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.unstable.vimPlugins;
#hotpot [
hotpot-nvim #hotpot
# ui hotpot-nvim
lualine-nvim nvim-navic
neo-tree-nvim # ui
fzf-vim lualine-nvim
vim-devicons neo-tree-nvim
nvim-web-devicons fzf-vim
telescope-nvim vim-devicons
plenary-nvim nvim-web-devicons
FTerm-nvim telescope-nvim
barbar-nvim plenary-nvim
neovim-ayu FTerm-nvim
rainbow_parentheses-vim barbar-nvim
auto-session neovim-ayu
which-key-nvim rainbow_parentheses-vim
aerial-nvim auto-session
todo-comments-nvim which-key-nvim
indent-blankline-nvim aerial-nvim
todo-comments-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: [
nvim-treesitter-context p.nix
nvim-treesitter-textobjects 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 # TODO
nvim-navic undotree
undotree marks-nvim
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
vim-zettel vim-zettel
hologram-nvim hologram-nvim
# lsp stuff # lsp stuff
nvim-lspconfig nvim-lspconfig
nvim-cmp nvim-cmp
cmp-nvim-lsp cmp-nvim-lsp
cmp-treesitter cmp-treesitter
# cmp-conjure # cmp-conjure
cmp-buffer cmp-buffer
cmp-path cmp-path
cmp-spell cmp-spell
lspkind-nvim lspkind-nvim
conform-nvim conform-nvim
none-ls-nvim none-ls-nvim
mini-nvim mini-nvim
lspsaga-nvim lspsaga-nvim
# nvim-lspfuzzy # nvim-lspfuzzy
# git stuff # git stuff
vim-fugitive vim-fugitive
gitsigns-nvim gitsigns-nvim
fzf-checkout-vim fzf-checkout-vim
# Clojure stuff # Clojure stuff
# conjure # conjure
vim-sexp vim-sexp
vim-sexp-mappings-for-regular-people vim-sexp-mappings-for-regular-people
fennel-vim fennel-vim
vim-tidal # nvim-luapad
# experimental scnvim
nvim-luapad flash-nvim
scnvim vim-beancount
flash-nvim ] ++ [ pkgs.vimPlugins.vim-tidal ];
vim-beancount
# vimtex
# 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;