From ad9530845903ba290fda4b65ee5834903969d98b Mon Sep 17 00:00:00 2001 From: RhiobeT Date: Wed, 24 Aug 2022 18:33:02 +0200 Subject: [PATCH] [NeoVim] Actually working bootstrap --- .config/nvim/fnl/plugins.fnl | 43 ++++++++++++---------- .config/nvim/fnl/settings/autopairs.fnl | 3 ++ .config/nvim/fnl/settings/bufferline.fnl | 2 + .config/nvim/fnl/settings/cinnamon.fnl | 3 ++ .config/nvim/fnl/settings/diffview.fnl | 1 + .config/nvim/fnl/settings/general.fnl | 6 +-- .config/nvim/fnl/settings/gitsigns.fnl | 3 ++ .config/nvim/fnl/settings/guess-indent.fnl | 3 ++ .config/nvim/fnl/settings/neo-tree.fnl | 8 ++++ .config/nvim/fnl/settings/null-ls.fnl | 1 - .config/nvim/fnl/settings/smart-splits.fnl | 1 + .config/nvim/fnl/settings/solarized.fnl | 1 + .config/nvim/fnl/settings/telescope.fnl | 1 + 13 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 .config/nvim/fnl/settings/autopairs.fnl create mode 100644 .config/nvim/fnl/settings/cinnamon.fnl create mode 100644 .config/nvim/fnl/settings/gitsigns.fnl create mode 100644 .config/nvim/fnl/settings/guess-indent.fnl diff --git a/.config/nvim/fnl/plugins.fnl b/.config/nvim/fnl/plugins.fnl index 728578b..8e809fc 100644 --- a/.config/nvim/fnl/plugins.fnl +++ b/.config/nvim/fnl/plugins.fnl @@ -8,22 +8,23 @@ (use! :udayvir-singh/hibiscus.nvim) (use! "~/.config/nvim/themes/solarized.nvim" - :config (require :settings.solarized)) + :module :settings.solarized) (use! :nvim-lua/popup.nvim - :config (require :popup)) + :module :popup) (use! :nvim-treesitter/nvim-treesitter :run ":TSUpdate" - :config (require :settings.treesitter)) + :module :settings.treesitter) (use! :feline-nvim/feline.nvim :requires [:kyazdani42/nvim-web-devicons "~/.config/nvim/themes/solarized.nvim"] - :config (require :settings.feline)) + :after [:solarized.nvim] + :module :settings.feline) (use! :s1n7ax/nvim-window-picker - :config (require :settings.window-picker)) + :module :settings.window-picker) (use! :nvim-neo-tree/neo-tree.nvim :branch "v2.x" @@ -32,44 +33,48 @@ :kyazdani42/nvim-web-devicons :MunifTanjim/nui.nvim :s1n7ax/nvim-window-picker] - :config (require :settings.neo-tree)) + :after [:nvim-window-picker] + :module :settings.neo-tree) (use! :mrjones2014/smart-splits.nvim - :config (require :settings.smart-splits)) + :module :settings.smart-splits) (use! :famiu/bufdelete.nvim - :config (require :bufdelete)) + :module :bufdelete) (use! :akinsho/bufferline.nvim :tag "v2.*" :requires [:kyazdani42/nvim-web-devicons :famiu/bufdelete.nvim "~/.config/nvim/themes/solarized.nvim"] - :config (require :settings.bufferline)) + :after [:bufdelete.nvim + :solarized.nvim] + :module :settings.bufferline) (use! :windwp/nvim-autopairs - :config (setup :nvim-autopairs)) + :module :settings.autopairs) (use! :lewis6991/gitsigns.nvim - :config (setup :gitsigns)) + :module :settings.gitsigns) (use! :declancm/cinnamon.nvim - :config (setup :cinnamon)) + :module :settings.cinnamon) (use! :stevearc/aerial.nvim - :config (require :settings.aerial)) + :module :settings.aerial) (use! :nmac427/guess-indent.nvim - :config (setup :guess-indent)) + :module :settings.guess-indent) (use! :nvim-telescope/telescope.nvim :requires [:nvim-lua/plenary.nvim :s1n7ax/nvim-window-picker] - :config (require :settings.telescope)) + :after [:nvim-window-picker] + :module :settings.telescope) (use! :sindrets/diffview.nvim :requires [:nvim-lua/plenary.nvim] - :config (require :settings.diffview)) + :module :settings.diffview) (use! :neovim/nvim-lspconfig :requires [:williamboman/mason-lspconfig.nvim @@ -81,10 +86,10 @@ :saadparwaiz1/cmp_luasnip :rafamadriz/friendly-snippets :L3MON4D3/LuaSnip] - :config (require :settings.lspconfig)) + :module :settings.lspconfig) (use! :jose-elias-alvarez/null-ls.nvim - :config (require :settings.null-ls)) + :module :settings.null-ls) (use! :lervag/vimtex - :config (require :settings.vimtex))) + :module :settings.vimtex)) diff --git a/.config/nvim/fnl/settings/autopairs.fnl b/.config/nvim/fnl/settings/autopairs.fnl new file mode 100644 index 0000000..f550c82 --- /dev/null +++ b/.config/nvim/fnl/settings/autopairs.fnl @@ -0,0 +1,3 @@ +(import-macros {: setup} :macros) + +(setup :nvim-autopairs) diff --git a/.config/nvim/fnl/settings/bufferline.fnl b/.config/nvim/fnl/settings/bufferline.fnl index b69da14..81fa251 100644 --- a/.config/nvim/fnl/settings/bufferline.fnl +++ b/.config/nvim/fnl/settings/bufferline.fnl @@ -2,6 +2,7 @@ (import-macros {: setup} :macros) (local colors (require :solarized.colors)) + (setup :bufferline { :options {:close_command "Bdelete %d" :right_mouse_command "Bdelete %d" @@ -12,6 +13,7 @@ :highlights {:separator {:fg colors.bg_alt} :separator_visible {:fg colors.bg_alt} :separator_selected {:fg colors.bg_alt}}}) + (map! [n] : ":bnext") (map! [n] : ":bprevious") (map! [n] :q ":Bdelete") diff --git a/.config/nvim/fnl/settings/cinnamon.fnl b/.config/nvim/fnl/settings/cinnamon.fnl new file mode 100644 index 0000000..0853d47 --- /dev/null +++ b/.config/nvim/fnl/settings/cinnamon.fnl @@ -0,0 +1,3 @@ +(import-macros {: setup} :macros) + +(setup :cinnamon) diff --git a/.config/nvim/fnl/settings/diffview.fnl b/.config/nvim/fnl/settings/diffview.fnl index f0e5a62..e3b283e 100644 --- a/.config/nvim/fnl/settings/diffview.fnl +++ b/.config/nvim/fnl/settings/diffview.fnl @@ -5,5 +5,6 @@ :keymaps {:view {:q ":tabc"} :file_panel {:q ":tabc"} :file_history_panel {:q ":tabc"}}}) + (map! [n] :r ":DiffviewOpen") (map! [n] :R ":DiffviewFileHistory %") diff --git a/.config/nvim/fnl/settings/general.fnl b/.config/nvim/fnl/settings/general.fnl index 6aa4941..da9837f 100644 --- a/.config/nvim/fnl/settings/general.fnl +++ b/.config/nvim/fnl/settings/general.fnl @@ -1,6 +1,7 @@ (import-macros {: g! : set!} :hibiscus.vim) (g! :maplocalleader ",") + (set! :clipboard "unnamedplus") (set! :expandtab true) (set! :fileencoding "utf-8") @@ -13,8 +14,3 @@ (set! :smartcase true) (set! :spelllang "en") (set! :tabstop 2) - -; Startup -(if (or (= (vim.fn.expand "%") "") (not= (vim.fn.isdirectory (vim.fn.expand "%")) 0)) - ((. (require :neo-tree.command) :_command) (vim.fn.getcwd)) - ((. (require :neo-tree.command) :_command) "show" (vim.fn.getcwd))) diff --git a/.config/nvim/fnl/settings/gitsigns.fnl b/.config/nvim/fnl/settings/gitsigns.fnl new file mode 100644 index 0000000..c62d1d3 --- /dev/null +++ b/.config/nvim/fnl/settings/gitsigns.fnl @@ -0,0 +1,3 @@ +(import-macros {: setup} :macros) + +(setup :gitsigns) diff --git a/.config/nvim/fnl/settings/guess-indent.fnl b/.config/nvim/fnl/settings/guess-indent.fnl new file mode 100644 index 0000000..8bc95db --- /dev/null +++ b/.config/nvim/fnl/settings/guess-indent.fnl @@ -0,0 +1,3 @@ +(import-macros {: setup} :macros) + +(setup :guess-indent) diff --git a/.config/nvim/fnl/settings/neo-tree.fnl b/.config/nvim/fnl/settings/neo-tree.fnl index 1aad087..e1297c8 100644 --- a/.config/nvim/fnl/settings/neo-tree.fnl +++ b/.config/nvim/fnl/settings/neo-tree.fnl @@ -2,6 +2,7 @@ (import-macros {: setup} :macros) (g! :neo_tree_remove_legacy_commands 1) + (setup :neo-tree { :close_if_last_window true :window {:width 30 @@ -31,6 +32,13 @@ [:modified] [:diagnostics] [:git_status]]}}) + (map! [n] :f ":Neotree focus") (map! [n] :F (fn [] (exec [[:Neotree "toggle"] [:Neotree "toggle" "action=show"]]))) + (augroup! :neo-tree [[FileType] [qf] "set nobuflisted|call feedkeys(\"F\")"]) + +; Startup +(if (or (= (vim.fn.expand "%") "") (not= (vim.fn.isdirectory (vim.fn.expand "%")) 0)) + ((. (require :neo-tree.command) :_command) (vim.fn.getcwd)) + ((. (require :neo-tree.command) :_command) "show" (vim.fn.getcwd))) diff --git a/.config/nvim/fnl/settings/null-ls.fnl b/.config/nvim/fnl/settings/null-ls.fnl index 99f7ff1..37be446 100644 --- a/.config/nvim/fnl/settings/null-ls.fnl +++ b/.config/nvim/fnl/settings/null-ls.fnl @@ -2,4 +2,3 @@ (setup :null-ls { :sources [(. (. (. (require :null-ls) :builtins) :diagnostics) :flake8)]}) - diff --git a/.config/nvim/fnl/settings/smart-splits.fnl b/.config/nvim/fnl/settings/smart-splits.fnl index a0106bb..59c0290 100644 --- a/.config/nvim/fnl/settings/smart-splits.fnl +++ b/.config/nvim/fnl/settings/smart-splits.fnl @@ -1,6 +1,7 @@ (import-macros {: map!} :hibiscus.vim) (local smart-splits (require :smart-splits)) + (map! [n] : smart-splits.move_cursor_left) (map! [n] : smart-splits.move_cursor_down) (map! [n] : smart-splits.move_cursor_up) diff --git a/.config/nvim/fnl/settings/solarized.fnl b/.config/nvim/fnl/settings/solarized.fnl index c62e278..b7d2b5f 100644 --- a/.config/nvim/fnl/settings/solarized.fnl +++ b/.config/nvim/fnl/settings/solarized.fnl @@ -7,4 +7,5 @@ (g! :solarized_contrast true) (g! :solarized_borders false) (g! :solarized_disable_background false) + ((. (require :solarized) :set)) diff --git a/.config/nvim/fnl/settings/telescope.fnl b/.config/nvim/fnl/settings/telescope.fnl index e77d67b..4bab0ee 100644 --- a/.config/nvim/fnl/settings/telescope.fnl +++ b/.config/nvim/fnl/settings/telescope.fnl @@ -1,6 +1,7 @@ (import-macros {: setup} :macros) (local actions (require :telescope.actions)) + (setup :telescope { :defaults {:mappings {:n {:S actions.file_split :s actions.file_vsplit}}