diff options
Diffstat (limited to 'nvim/fnl')
29 files changed, 414 insertions, 0 deletions
diff --git a/nvim b/nvim deleted file mode 160000 -Subproject d2e1e6a0d60cf427a8a56c0caf57c8ec60a8e36 diff --git a/nvim/fnl/config/lazy.fnl b/nvim/fnl/config/lazy.fnl new file mode 100644 index 0000000..c75302d --- /dev/null +++ b/nvim/fnl/config/lazy.fnl @@ -0,0 +1,30 @@ +(local lazypath (.. (vim.fn.stdpath :data) :/lazy/lazy.nvim)) + +(if (not ((. (or vim.uv vim.loop) :fs_stat) lazypath)) + (let [lazyrepo "https://github.com/folke/lazy.nvim.git" + out (vim.fn.system [:git + :clone + "--filter=blob:none" + :--branch=stable + lazyrepo + lazypath])] + (if (not= vim.v.shell_error 0) + (do + (vim.api.nvim_echo [["Failed to clone lazy.nvim:\n" :ErrorMsg] + [out :WarningMsg] + ["\nPress any key to exit..."]] + true {}) + (vim.fn.getchar) + (os.exit 1)) (do + ))) + (do + )) + +(vim.opt.rtp:prepend lazypath) + +((. (require :lazy) :setup) {:checker {:enabled true} + :install {:colorscheme [:habamax]} + :spec [{:import :plugins}]}) + +{:fennel-path :./lazy.lua} + diff --git a/nvim/fnl/filetype.fnl b/nvim/fnl/filetype.fnl new file mode 100644 index 0000000..1f89999 --- /dev/null +++ b/nvim/fnl/filetype.fnl @@ -0,0 +1,26 @@ +(local M {}) + +;; file type gohtmltmpl +(vim.api.nvim_create_autocmd + [:BufRead :BufNewFile] + {:callback (fn [args] + (when (not vim.g.go_loaded) + (local content + (vim.fn.readfile args.file + "" 50)) + (var has-template false) + (each [_ line (ipairs content)] + (when (or (line:match "{{.<>}}") + (line:match "{{.*}}")) + (set has-template true) + (lua :break))) + (when has-template + (tset (. vim.bo args.buf) + :filetype :gohtmltmpl)))) + :pattern [:*.html :*.tmpl :*.gohtml]}) + +(vim.filetype.add {:extension {:scm "scheme"}}) +(vim.filetype.add {:extension {:skr "scheme"}}) + +M + diff --git a/nvim/fnl/plugins/blink.fnl b/nvim/fnl/plugins/blink.fnl new file mode 100644 index 0000000..f1e034d --- /dev/null +++ b/nvim/fnl/plugins/blink.fnl @@ -0,0 +1,10 @@ +{1 :saghen/blink.cmp + :dependencies [:rafamadriz/friendly-snippets] + :opts {:appearance {:nerd_font_variant :mono} + :completion {:documentation {:auto_show false} + :ghost_text {:enabled true}} + :fuzzy {:implementation :prefer_rust_with_warning} + :keymap {:preset :enter} + :sources {:default [:lsp :path :snippets :buffer]}} + :opts_extend [:sources.default] + :version :1.*} diff --git a/nvim/fnl/plugins/conjure.fnl b/nvim/fnl/plugins/conjure.fnl new file mode 100644 index 0000000..8fb6630 --- /dev/null +++ b/nvim/fnl/plugins/conjure.fnl @@ -0,0 +1,2 @@ +[:Olical/conjure] + diff --git a/nvim/fnl/plugins/encrypt.fnl b/nvim/fnl/plugins/encrypt.fnl new file mode 100644 index 0000000..2a17f4f --- /dev/null +++ b/nvim/fnl/plugins/encrypt.fnl @@ -0,0 +1,2 @@ +{1 :elentok/encrypt.nvim :opts {}} + diff --git a/nvim/fnl/plugins/flash-zh.fnl b/nvim/fnl/plugins/flash-zh.fnl new file mode 100644 index 0000000..b745d64 --- /dev/null +++ b/nvim/fnl/plugins/flash-zh.fnl @@ -0,0 +1,9 @@ +{1 :rainzm/flash-zh.nvim + :dependencies :folke/flash.nvim + :event :VeryLazy + :keys [{1 :s + 2 (fn [] + ((. (require :flash-zh) :jump) {:chinese_only false})) + :desc "Flash between Chinese" + :mode [:n :x :o]}]} + diff --git a/nvim/fnl/plugins/flash.fnl b/nvim/fnl/plugins/flash.fnl new file mode 100644 index 0000000..3acae81 --- /dev/null +++ b/nvim/fnl/plugins/flash.fnl @@ -0,0 +1,4 @@ +{1 :folke/flash.nvim + :event :VeryLazy + :opts {:modes {:char {:enabled false}} + :remote_op {:motion true :restore true}}} diff --git a/nvim/fnl/plugins/im-select.fnl b/nvim/fnl/plugins/im-select.fnl new file mode 100644 index 0000000..e26c2ac --- /dev/null +++ b/nvim/fnl/plugins/im-select.fnl @@ -0,0 +1,4 @@ +{1 :keaising/im-select.nvim + :config (fn [] + ((. (require :im_select) :setup) {:default_command :macism}))} + diff --git a/nvim/fnl/plugins/jieba.fnl b/nvim/fnl/plugins/jieba.fnl new file mode 100644 index 0000000..99620a4 --- /dev/null +++ b/nvim/fnl/plugins/jieba.fnl @@ -0,0 +1,5 @@ +[[:tpope/vim-repeat] + {1 :kkew3/jieba.vim + :branch :release + :build ":call jieba_vim#install()" + :init (fn [] (set vim.g.jieba_vim_lazy 1) (set vim.g.jieba_vim_keymap 1))}] diff --git a/nvim/fnl/plugins/kanagawa.fnl b/nvim/fnl/plugins/kanagawa.fnl new file mode 100644 index 0000000..e77e447 --- /dev/null +++ b/nvim/fnl/plugins/kanagawa.fnl @@ -0,0 +1,8 @@ +{1 :rebelot/kanagawa.nvim + :config (fn [] + ((. (require :kanagawa) :setup) + {:compile true + :theme :dragon}) + (vim.cmd "colorscheme kanagawa-dragon")) + :lazy false} + diff --git a/nvim/fnl/plugins/lazygit.fnl b/nvim/fnl/plugins/lazygit.fnl new file mode 100644 index 0000000..f89719f --- /dev/null +++ b/nvim/fnl/plugins/lazygit.fnl @@ -0,0 +1,10 @@ +{1 :kdheepak/lazygit.nvim + :cmd [:LazyGit + :LazyGitConfig + :LazyGitCurrentFile + :LazyGitFilter + :LazyGitFilterCurrentFile] + :dependencies [:nvim-lua/plenary.nvim] + :keys [{1 :<leader>lg 2 :<cmd>LazyGit<cr> :desc :LazyGit}] + :lazy true} + diff --git a/nvim/fnl/plugins/lexima.fnl b/nvim/fnl/plugins/lexima.fnl new file mode 100644 index 0000000..45bcbdc --- /dev/null +++ b/nvim/fnl/plugins/lexima.fnl @@ -0,0 +1,2 @@ +{1 :cohama/lexima.vim :config (fn [])} + diff --git a/nvim/fnl/plugins/lualine.fnl b/nvim/fnl/plugins/lualine.fnl new file mode 100644 index 0000000..2da54aa --- /dev/null +++ b/nvim/fnl/plugins/lualine.fnl @@ -0,0 +1,79 @@ +{1 :nvim-lualine/lualine.nvim + :config (fn [] + ;; THEME + (fn kanagawa-lualine-theme [] + (var colors nil) + (set colors + ((. (require :kanagawa.colors) :setup) {:theme :dragon})) + (local palette colors.palette) + {:command {:a {:bg palette.dragonOrange + :fg palette.dragonBlack0 + :gui :bold} + :b {:bg palette.dragonBlack4 + :fg palette.dragonWhite} + :c {:bg palette.dragonBlack0 + :fg palette.dragonWhite}} + :inactive {:a {:bg palette.dragonBlack2 + :fg palette.dragonBlack6} + :b {:bg palette.dragonBlack2 + :fg palette.dragonBlack6} + :c {:bg palette.dragonBlack0 + :fg palette.dragonBlack6}} + :insert {:a {:bg palette.dragonGreen + :fg palette.dragonBlack0 + :gui :bold} + :b {:bg palette.dragonBlack4 + :fg palette.dragonWhite} + :c {:bg palette.dragonBlack0 + :fg palette.dragonWhite}} + :normal {:a {:bg palette.dragonBlue2 + :fg palette.dragonBlack0 + :gui :bold} + :b {:bg palette.dragonBlack4 + :fg palette.dragonWhite} + :c {:bg palette.dragonBlack0 + :fg palette.dragonWhite}} + :replace {:a {:bg palette.dragonRed + :fg palette.dragonBlack0 + :gui :bold} + :b {:bg palette.dragonBlack4 + :fg palette.dragonWhite} + :c {:bg palette.dragonBlack0 + :fg palette.dragonWhite}} + :visual {:a {:bg palette.dragonViolet + :fg palette.dragonBlack0 + :gui :bold} + :b {:bg palette.dragonBlack4 + :fg palette.dragonWhite} + :c {:bg palette.dragonBlack0 + :fg palette.dragonWhite}}}) + + ;; Custom components + (fn wordcount [] + (.. + "W:" + (: (require :wordcounter) :count_cur_buf_words))) + + ((. (require :lualine) :setup) {:inactive_sections {:lualine_a {} + :lualine_b {} + :lualine_c [:filename] + :lualine_x [:location] + :lualine_y {} + :lualine_z {}} + :options {:component_separators {:left "" + :right ""} + :section_separators {:left "" + :right ""} + :theme (kanagawa-lualine-theme)} + :sections {:lualine_a [:mode] + :lualine_b [:branch + :diff + :diagnostics] + :lualine_c [:filename] + :lualine_x [wordcount + :fileformat + :filetype] + :lualine_y [:progress] + :lualine_z [:location]}})) + :dependencies [:nvim-tree/nvim-web-devicons :rebelot/kanagawa.nvim]} + diff --git a/nvim/fnl/plugins/markdown-plus.fnl b/nvim/fnl/plugins/markdown-plus.fnl new file mode 100644 index 0000000..c5636d8 --- /dev/null +++ b/nvim/fnl/plugins/markdown-plus.fnl @@ -0,0 +1,6 @@ +{1 :yousefhadder/markdown-plus.nvim + :version :v2.1.0 + :ft :markdown + :opts {:keymaps {:enabled true} + :table {:keymaps {:enabled true}}}} + diff --git a/nvim/fnl/plugins/mason.fnl b/nvim/fnl/plugins/mason.fnl new file mode 100644 index 0000000..a4f86e7 --- /dev/null +++ b/nvim/fnl/plugins/mason.fnl @@ -0,0 +1,2 @@ +{1 :mason-org/mason.nvim :opts {}} + diff --git a/nvim/fnl/plugins/nfnl.fnl b/nvim/fnl/plugins/nfnl.fnl new file mode 100644 index 0000000..ca8ef2b --- /dev/null +++ b/nvim/fnl/plugins/nfnl.fnl @@ -0,0 +1,2 @@ +[:Olical/nfnl] + diff --git a/nvim/fnl/plugins/nvim-lspconfig.fnl b/nvim/fnl/plugins/nvim-lspconfig.fnl new file mode 100644 index 0000000..1c38cf3 --- /dev/null +++ b/nvim/fnl/plugins/nvim-lspconfig.fnl @@ -0,0 +1,48 @@ +[{1 :neovim/nvim-lspconfig + :config (fn [] + (local lsps [:gopls + :marksman + :ts_ls + :vue_ls + :cssls + :html + :unocss + :clojure_lsp + :ruff + :ty + :tinymist + :fennel_ls + :ltex]) + ((. (require :mason-lspconfig) :setup) {:ensure_installed lsps}) + (vim.lsp.config :lua_ls + {:settings {:Lua {:diagnostics {:globals [:vim]}}}}) + (local vue-language-server-path + (.. (vim.fn.expand :$MASON/packages) :/vue-language-server + "/node_modules/@vue/language-server")) + (local tsserver-filetypes + [:typescript + :javascript + :javascriptreact + :typescriptreact + :vue]) + (local vue-plugin + {:configNamespace :typescript + :languages [:vue] + :location vue-language-server-path + :name "@vue/typescript-plugin"}) + (local ts-ls-config + {:filetypes tsserver-filetypes + :init_options {:plugins [vue-plugin]}}) + (local vue-ls-config {}) + (local ltex-ls-config + {:settings {:ltex {:dictionary {:en-US [:Neovim :LSP :ltex-ls :Lua] + :zh-CN [:Neovim :LSP :ltex-ls :Lua]} + :disabledRules {:zh-CN [:EN_QUOTES]} + :language :zh-CN}}}) + (vim.lsp.config :vue_ls vue-ls-config) + (vim.lsp.config :ts_ls ts-ls-config) + (vim.lsp.config :ltex ltex-ls-config) + (vim.lsp.enable lsps)) + :dependencies [:mason-org/mason.nvim + :mason-org/mason-lspconfig.nvim]}] + diff --git a/nvim/fnl/plugins/nvim-telescope.fnl b/nvim/fnl/plugins/nvim-telescope.fnl new file mode 100644 index 0000000..fcefefd --- /dev/null +++ b/nvim/fnl/plugins/nvim-telescope.fnl @@ -0,0 +1,22 @@ +{1 :nvim-telescope/telescope.nvim + :dependencies [:nvim-lua/plenary.nvim + {1 :nvim-telescope/telescope-fzf-native.nvim :build :make}] + :opts (fn [_ opts] (local builtin (require :telescope.builtin)) + (vim.keymap.set :n :<leader>ff builtin.find_files + {:desc "Telescope find files"}) + (vim.keymap.set :n :<leader>fg builtin.live_grep + {:desc "Telescope live grep"}) + (vim.keymap.set :n :<leader>fb builtin.buffers + {:desc "Telescope buffers"}) + (vim.keymap.set :n :<leader>fh builtin.help_tags + {:desc "Telescope help tags"}) + (vim.keymap.set :n :<leader>fc builtin.commands + {:desc "Telescope commands"}) + (vim.keymap.set :n :<leader>fd builtin.lsp_document_symbols + {:desc "Telescope LSP symbols in current buffer."}) + (vim.keymap.set :n :<leader>fr builtin.lsp_references + {:desc "Telescope LSP references"}) + (vim.keymap.set :n :<leader>fs builtin.lsp_workspace_symbols + {:desc "Telescope LSP symbols in current workspace."})) + :version "*"} + diff --git a/nvim/fnl/plugins/nvim-toggler.fnl b/nvim/fnl/plugins/nvim-toggler.fnl new file mode 100644 index 0000000..031f0c9 --- /dev/null +++ b/nvim/fnl/plugins/nvim-toggler.fnl @@ -0,0 +1,4 @@ +{1 :nguyenvukhang/nvim-toggler + :opts (fn [_ opts] + ((. (require :nvim-toggler) :setup)))} + diff --git a/nvim/fnl/plugins/nvim-treesitter.fnl b/nvim/fnl/plugins/nvim-treesitter.fnl new file mode 100644 index 0000000..fbdd85f --- /dev/null +++ b/nvim/fnl/plugins/nvim-treesitter.fnl @@ -0,0 +1,20 @@ +{1 :nvim-treesitter/nvim-treesitter + :build ":TSUpdate" + :config (fn [] + ((. (require :nvim-treesitter) :setup)) + ((. (require :nvim-treesitter) :install) [:javascript + :html + :css + :go + :clojure + :gitignore + :gotmpl + :markdown + :lua + :python + :typst + :fennel + :scheme + :commonlisp])) + :lazy false} + diff --git a/nvim/fnl/plugins/oil.fnl b/nvim/fnl/plugins/oil.fnl new file mode 100644 index 0000000..4af1a5f --- /dev/null +++ b/nvim/fnl/plugins/oil.fnl @@ -0,0 +1,7 @@ +{1 :stevearc/oil.nvim + :config (fn [] + ((. (require :oil) :setup))) + :dependencies [{1 :nvim-mini/mini.icons :opts {}}] + :lazy false + :opts {}} + diff --git a/nvim/fnl/plugins/paredit.fnl b/nvim/fnl/plugins/paredit.fnl new file mode 100644 index 0000000..88d643a --- /dev/null +++ b/nvim/fnl/plugins/paredit.fnl @@ -0,0 +1,4 @@ +{1 :julienvincent/nvim-paredit + :config (fn [] + ((. (require :nvim-paredit) :setup)))} + diff --git a/nvim/fnl/plugins/render-markdown.fnl b/nvim/fnl/plugins/render-markdown.fnl new file mode 100644 index 0000000..a918a15 --- /dev/null +++ b/nvim/fnl/plugins/render-markdown.fnl @@ -0,0 +1,4 @@ +{1 :MeanderingProgrammer/render-markdown.nvim + :dependencies [:nvim-treesitter/nvim-treesitter :nvim-tree/nvim-web-devicons] + :opts {}} + diff --git a/nvim/fnl/plugins/startup.fnl b/nvim/fnl/plugins/startup.fnl new file mode 100644 index 0000000..cab3513 --- /dev/null +++ b/nvim/fnl/plugins/startup.fnl @@ -0,0 +1,75 @@ +{1 :startup-nvim/startup.nvim + :config (fn [] + ((. (require :startup) :setup) {:body {:align :center + :content [[" Find File" + "Telescope find_files" + :<leader>ff] + [" Find Word" + "Telescope live_grep" + :<leader>lg] + [" Recent Files" + "Telescope oldfiles" + :<leader>of] + [" File Browser" + "Telescope file_browser" + :<leader>fb] + [" New File" + "lua require'startup'.new_file()" + :<leader>nf]] + :default_color "" + :fold_section false + :highlight :String + :margin 5 + :oldfiles_amount 0 + :oldfiles_directory false + :title "Basic Commands" + :type :mapping} + :colors {:background "#1f2227" + :folded_section "#56b6c2"} + :footer {:align :center + :content [:eltrac.nvim] + :default_color "" + :fold_section false + :highlight :Number + :margin 5 + :oldfiles_amount 0 + :oldfiles_directory false + :title :Footer + :type :text} + :header {:align :center + :content [" " + " " + " ,-. _,---._ __ / \\ " + " / ) .-' `./ / \\ " + "( ( ,' `/ /|" + " \\ `-\" \\'\\ / |" + " `. , \\ \\ / |" + " /`. ,'-`----Y |" + " ( ; | '" + " | ,-. ,-' | / " + " | | ( | | / " + " ) | \\ `.___________|/ " + " `--' `--' "] + :default_color "" + :fold_section false + :highlight :Statement + :margin 5 + :oldfiles_amount 0 + :oldfiles_directory false + :title :Header + :type :text} + :mappings {:execute_command :<CR> + :open_file :o + :open_file_split :<c-o> + :open_help "?" + :open_section :<TAB>} + :options {:cursor_column 0.5 + :disable_statuslines true + :empty_lines_between_mappings true + :mapping_keys true + :paddings [1 3 3 0]} + :parts [:header :body :footer]})) + :dependencies [:nvim-telescope/telescope.nvim + :nvim-lua/plenary.nvim + :nvim-telescope/telescope-file-browser.nvim]} + diff --git a/nvim/fnl/plugins/vim-go.fnl b/nvim/fnl/plugins/vim-go.fnl new file mode 100644 index 0000000..caa8693 --- /dev/null +++ b/nvim/fnl/plugins/vim-go.fnl @@ -0,0 +1,15 @@ +{1 :fatih/vim-go + :build ":GoUpdateBinaries" + :config (fn [] (set vim.g.go_fmt_command :goimports) + (set vim.g.go_metalinter_enabled [:vet :golint :errcheck]) + (set vim.g.go_metalinter_autosave 1) + (set vim.g.go_doc_keywordprg_enabled 0) + (set vim.g.go_def_mapping_enabled 0) + (set vim.g.go_code_completion_enabled 0) + (set vim.g.go_template_syntax 1) + (set vim.g.go_template_use_html 1) + (vim.keymap.set :n :<leader>gr :<cmd>GoRun<cr> {:desc "Go Run"}) + (vim.keymap.set :n :<leader>gb :<cmd>GoBuild<cr> {:desc "Go Build"}) + (vim.keymap.set :n :<leader>gt :<cmd>GoTest<cr> {:desc "Go Test"})) + :ft [:go :gohtmltmpl :gotexttmpl :gomod :gowork]} + diff --git a/nvim/fnl/plugins/wakatime.fnl b/nvim/fnl/plugins/wakatime.fnl new file mode 100644 index 0000000..f1598a0 --- /dev/null +++ b/nvim/fnl/plugins/wakatime.fnl @@ -0,0 +1,4 @@ +(set vim.env.WAKATIME_HOME (.. (or vim.env.XDG_CONFIG_HOME (.. (vim.fn.expand "~") "/.config")) "/wakatime")) + +{1 :wakatime/vim-wakatime :lazy false} + diff --git a/nvim/fnl/plugins/whichkey.fnl b/nvim/fnl/plugins/whichkey.fnl new file mode 100644 index 0000000..be82820 --- /dev/null +++ b/nvim/fnl/plugins/whichkey.fnl @@ -0,0 +1,8 @@ +{1 :folke/which-key.nvim + :event :VeryLazy + :keys [{1 :<leader>? + 2 (fn [] + ((. (require :which-key) :show) {:global false})) + :desc "Buffer Local Keymaps (which-key)"}] + :opts {}} + diff --git a/nvim/fnl/plugins/wordcount.fnl b/nvim/fnl/plugins/wordcount.fnl new file mode 100644 index 0000000..0035c77 --- /dev/null +++ b/nvim/fnl/plugins/wordcount.fnl @@ -0,0 +1,2 @@ +{1 :npc-z/wordcounter.nvim + :dependencies :uga-rosa/utf8.nvim} |
