From c3452161c118bbac031c623ce0146fb602c0623b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 31 Mar 2022 00:07:33 +0200 Subject: feat(settings): add init --- fnl/settings/init.fnl | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 fnl/settings/init.fnl diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl new file mode 100644 index 0000000..9546224 --- /dev/null +++ b/fnl/settings/init.fnl @@ -0,0 +1,5 @@ +-- Load nvim settings +(module settings) + +(require :settings.options) +(require :settings.keymaps) -- cgit v1.2.3-70-g09d2 From 8922578321d9e3a0be5d6dbedabd039406c2740b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 31 Mar 2022 00:07:48 +0200 Subject: feat(settings): add keymaps --- fnl/settings/keymaps.fnl | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 fnl/settings/keymaps.fnl diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl new file mode 100644 index 0000000..9c4b0e8 --- /dev/null +++ b/fnl/settings/keymaps.fnl @@ -0,0 +1,57 @@ +-- Custom keymappings. +(module settings.keymaps + {autoload {nvim aniseed.nvim}}) + +(def- opts {:noremap true :silent true}) +(defn- map [mode lhs rhs opt] + (nvim.set_keymap mode lhs rhs opt) + +--Remap space as leader key +(map "" "" "" opts) + +-- Modes +-- normal_mode = "n" +-- insert_mode = "i" +-- visual_mode = "v" +-- visual_block_mode = "x" +-- term_mode = "t" +-- command_mode = "c" + +-- Normal -- +-- Better window navigation +(map "n" "" "h" opts) +(map "n" "" "j" opts) +(map "n" "" "k" opts) +(map "n" "" "l" opts) + + +-- Resize with arrows +(map "n" "" ":resize -2" opts) +(map "n" "" ":resize +2" opts) +(map "n" "" ":vertical resize -2" opts) +(map "n" "" ":vertical resize +2" opts) + +-- Navigate buffers +(map "n" "" ":bnext" opts) +(map "n" "" ":bprevious" opts) + +-- Insert -- +-- Press jk fast to enter +(map "i" "jk" "" opts) + +-- Visual -- +-- Stay in indent mode +(map "v" "<" "" ">gv" opts) + +-- Move text up and down +(map "v" "" ":m .+1==" opts) +(map "v" "" ":m .-2==" opts) +(map "v" "p" '"_dP' opts) + +-- Visual Block -- +-- Move text up and down +(map "x" "J" ":move '>+1gv-gv" opts) +(map "x" "K" ":move '<-2gv-gv" opts) +(map "x" "" ":move '>+1gv-gv" opts) +(map "x" "" ":move '<-2gv-gv" opts) -- cgit v1.2.3-70-g09d2 From 08f55a31684adc5f801d0c7ccaef885e26f21ba1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:24:20 +0200 Subject: feat: fnl plugin cfg (wip) --- fnl/config/init.fnl | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 fnl/config/init.fnl diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-70-g09d2 From 10176dee7a85dfdb8729232ab0ecec408246a269 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:24:47 +0200 Subject: fix(settings): update settings --- fnl/settings/init.fnl | 2 +- fnl/settings/keymaps.fnl | 54 +++++++++++++++++++++++++----------------------- fnl/settings/options.fnl | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 fnl/settings/options.fnl diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl index 9546224..0045fc2 100644 --- a/fnl/settings/init.fnl +++ b/fnl/settings/init.fnl @@ -1,4 +1,4 @@ --- Load nvim settings +;; Load nvim settings (module settings) (require :settings.options) diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 9c4b0e8..b6c826a 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -1,4 +1,4 @@ --- Custom keymappings. +;; Custom keymappings. (module settings.keymaps {autoload {nvim aniseed.nvim}}) @@ -6,52 +6,54 @@ (defn- map [mode lhs rhs opt] (nvim.set_keymap mode lhs rhs opt) ---Remap space as leader key +;;Remap space as leader key (map "" "" "" opts) - --- Modes --- normal_mode = "n" --- insert_mode = "i" --- visual_mode = "v" --- visual_block_mode = "x" --- term_mode = "t" --- command_mode = "c" - --- Normal -- --- Better window navigation +(set nvim.g.mapleader " ") +(set nvim.g.maplocalleader " ") + +;; Modes +;; normal_mode = "n" +;; insert_mode = "i" +;; visual_mode = "v" +;; visual_block_mode = "x" +;; term_mode = "t" +;; command_mode = "c" + +;; Normal ;; +;; Better window navigation (map "n" "" "h" opts) (map "n" "" "j" opts) (map "n" "" "k" opts) (map "n" "" "l" opts) --- Resize with arrows +;; Resize with arrows (map "n" "" ":resize -2" opts) (map "n" "" ":resize +2" opts) (map "n" "" ":vertical resize -2" opts) (map "n" "" ":vertical resize +2" opts) --- Navigate buffers +;; Navigate buffers (map "n" "" ":bnext" opts) (map "n" "" ":bprevious" opts) --- Insert -- --- Press jk fast to enter +;; Insert ;; +;; Press jk fast to enter (map "i" "jk" "" opts) --- Visual -- --- Stay in indent mode +;; Visual ;; +;; Stay in indent mode (map "v" "<" "" ">gv" opts) --- Move text up and down -(map "v" "" ":m .+1==" opts) -(map "v" "" ":m .-2==" opts) -(map "v" "p" '"_dP' opts) - --- Visual Block -- --- Move text up and down +;; Visual Block ;; +;; Move text up and down (map "x" "J" ":move '>+1gv-gv" opts) (map "x" "K" ":move '<-2gv-gv" opts) (map "x" "" ":move '>+1gv-gv" opts) (map "x" "" ":move '<-2gv-gv" opts) + +;; Move text up and down +(map "v" "" ":m .+1==" opts) +(map "v" "" ":m .-2==" opts) +(map "v" "p" '"_dP' opts) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl new file mode 100644 index 0000000..9cf42e5 --- /dev/null +++ b/fnl/settings/options.fnl @@ -0,0 +1,52 @@ +;; Sets options in neovim +(module settings.options + {autoload {nvim aniseed.nvim}}) + +(def- opts { + :backup false ;; creates a backup file + :clipboard "unnamedplus" ;; allows neovim to access the system clipboard + :cmdheight 2 ;; more space in the neovim command line for displaying messages + :completeopt { "menuone" "noselect" } ;; mostly just for cmp + :conceallevel 0 ;; so that `` is visible in markdown files + :fileencoding "utf-8" ;; the encoding written to a file + :hlsearch true ;; highlight all matches on previous search pattern + :ignorecase true ;; ignore case in search patterns + :mouse "" ;; disable the mouse to be used in neovim + :pumheight 10 ;; pop up menu height + :showmode false ;; we don't need to see things like ;; INSERT ;; anymore + :showtabline 2 ;; always show tabs + :smartcase true ;; smart case + :smartindent true ;; make indenting smarter again + :splitbelow true ;; force all horizontal splits to go below current window + :splitright true ;; force all vertical splits to go to the right of current window + :swapfile false ;; creates a swapfile + :termguicolors true ;; set term gui colors (most terminals support this) + :timeoutlen 1000 ;; time to wait for a mapped sequence to complete (in milliseconds) + :undofile true ;; enable persistent undo + :updatetime 300 ;; faster completion (4000ms default) + :writebackup false ;; if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited + :expandtab true ;; convert tabs to spaces + :shiftwidth 2 ;; the number of spaces inserted for each indentation + :tabstop 2 ;; insert 2 spaces for a tab + :cursorline true ;; highlight the current line + :number true ;; set numbered lines + :relativenumber true ;; set relative numbered lines + :numberwidth 4 ;; set number column width to 2 {default 4} + :signcolumn "yes" ;; always show the sign column, otherwise it would shift the text each time + :wrap false ;; display lines as one long line + :scrolloff 8 ;; is one of my fav + :sidescrolloff 8 + :guifont "monospace:h17" ;; the font used in graphical neovim applications + } +) + +(defn- apply-opts [opts] + (each [k v (pairs opts)] + (set vim.opt[k] v))) + +(set vim.cmd "set whichwrap+=<,>,[,],h,l") +(set vim.cmd [[set iskeyword+=-]]) +(set vim.cmd [[set formatoptions-=cro]]) +(nvim.ex.set "shortmess+=c") +(nvim.ex.set :spell) +(apply-opts) -- cgit v1.2.3-70-g09d2 From e251995343ac897e54780f36ce66ca3d2c81331f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:25:16 +0200 Subject: feat(plugins): add table of plugins --- fnl/plugins.fnl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 fnl/plugins.fnl diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl new file mode 100644 index 0000000..f3fac1c --- /dev/null +++ b/fnl/plugins.fnl @@ -0,0 +1,64 @@ +;; List of plugins +(module plugins) + +(def plugins +{ + :wbthomason/packer.nvim {} ;; Have packer manage itself + :lewis6991/impatient.nvim {} + :Olical/aniseed {} + + :nvim-lua/popup.nvim {} ;; An implementation of the Popup API from vim in Neovim + :nvim-lua/plenary.nvim {} ;; Useful lua functions used ny lots of plugins + + ;; Colorschemes + "aktersnurra/no-clown-fiesta.nvim" {} + + ;; LSP + :hrsh7th/nvim-cmp {} ;; The completion plugin + :hrsh7th/cmp-buffer {} ;; buffer completions + :hrsh7th/cmp-path {} ;; path completions + :hrsh7th/cmp-cmdline {} ;; cmdline completions + :saadparwaiz1/cmp_luasnip {} ;; snippet completions + :hrsh7th/cmp-nvim-lsp {} + :neovim/nvim-lspconfig {} + :williamboman/nvim-lsp-installer {} + :tamago324/nlsp-settings.nvim {} + :jose-elias-alvarez/null-ls.nvim {} + + ;; Snippets + :L3MON4D3/LuaSnip {} + :rafamadriz/friendly-snippets {} + + ;; Telescope + :nvim-telescope/telescope.nvim { :requires "nvim-lua/plenary.nvim" } + :nvim-telescope/telescope-fzf-native.nvim { :run "make" } + :nvim-telescope/telescope-file-browser.nvim {} + + ;; Treesitter + :nvim-treesitter/nvim-treesitter { :run ":TSUpdate" } + :JoosepAlviste/nvim-ts-context-commentstring {} + :nvim-treesitter/playground {} + + ;; Miscellaneous plugins + :windwp/nvim-autopairs {} + :numToStr/Comment.nvim {} + :lewis6991/gitsigns.nvim {} + :kyazdani42/nvim-web-devicons {} + :kyazdani42/nvim-tree.lua {} + :akinsho/bufferline.nvim {} + :moll/vim-bbye {} + + :nvim-lualine/lualine.nvim { :requires "kyazdani42/nvim-web-devicons" :opt true }} + :ahmedkhalf/project.nvim {} + :goolord/alpha-nvim {} + :antoinemadec/FixCursorHold.nvim {} ;; This is needed to fix lsp doc highlight + :folke/which-key.nvim {} + :folke/zen-mode.nvim {} + :windwp/nvim-spectre {} + :phaazon/hop.nvim {} + + :kevinhwang91/nvim-bqf { :event "BufRead" } + :norcalli/nvim-colorizer.lua {} + :nvim-orgmode/orgmode {} + } +) -- cgit v1.2.3-70-g09d2 From 6c426d5c48c4398186cf7f9bb52e20b45437c2df Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:25:32 +0200 Subject: feat(init): add init fnl --- fnl/init.fnl | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 fnl/init.fnl diff --git a/fnl/init.fnl b/fnl/init.fnl new file mode 100644 index 0000000..96c1aed --- /dev/null +++ b/fnl/init.fnl @@ -0,0 +1,6 @@ +;; Install, load settings, and load plugin configs. +(module init + {require { + _ install + _ settings + _ config}}) -- cgit v1.2.3-70-g09d2 From 96b8104149c526b048489264992034ecf94315c5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:25:54 +0200 Subject: feat(install): wip with fnl plugin installer --- fnl/install.fnl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 fnl/install.fnl diff --git a/fnl/install.fnl b/fnl/install.fnl new file mode 100644 index 0000000..33453ef --- /dev/null +++ b/fnl/install.fnl @@ -0,0 +1,22 @@ +;; Installs plugins with packer. +(module install + {autoload { + a aniseed.core + plugins plugins + packer packer + nvim aniseed.nvim}}) + +(defn- use [...] + (let [plugins [...]] + (packer.startup + (fn [use]) +) + +(defn- override-use [use] + (fn [plugin opts] + (use (a.assoc (or opts {}) 1 name)) +) + +(packer.startup( + fn use +)) -- cgit v1.2.3-70-g09d2 From cdbea7c284d536d4c1e0b29eeec47c2954567c5d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:27:19 +0200 Subject: chore(settings): remove lua settings --- lua/settings/init.lua | 4 ---- lua/settings/keymaps.lua | 59 ------------------------------------------------ lua/settings/options.lua | 48 --------------------------------------- 3 files changed, 111 deletions(-) delete mode 100644 lua/settings/init.lua delete mode 100644 lua/settings/keymaps.lua delete mode 100644 lua/settings/options.lua diff --git a/lua/settings/init.lua b/lua/settings/init.lua deleted file mode 100644 index dfcaf8f..0000000 --- a/lua/settings/init.lua +++ /dev/null @@ -1,4 +0,0 @@ --- Load nvim settings - -require "settings.options" -require "settings.keymaps" diff --git a/lua/settings/keymaps.lua b/lua/settings/keymaps.lua deleted file mode 100644 index 8d8ed73..0000000 --- a/lua/settings/keymaps.lua +++ /dev/null @@ -1,59 +0,0 @@ --- Custom keymappings. - -local opts = { noremap = true, silent = true } - --- Shorten function name -local keymap = vim.api.nvim_set_keymap - ---Remap space as leader key -keymap("", "", "", opts) -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- Modes --- normal_mode = "n", --- insert_mode = "i", --- visual_mode = "v", --- visual_block_mode = "x", --- term_mode = "t", --- command_mode = "c", - --- Normal -- --- Better window navigation -keymap("n", "", "h", opts) -keymap("n", "", "j", opts) -keymap("n", "", "k", opts) -keymap("n", "", "l", opts) - -keymap("n", "e", ":Lex 30", opts) - --- Resize with arrows -keymap("n", "", ":resize +2", opts) -keymap("n", "", ":resize -2", opts) -keymap("n", "", ":vertical resize -2", opts) -keymap("n", "", ":vertical resize +2", opts) - --- Navigate buffers -keymap("n", "", ":bnext", opts) -keymap("n", "", ":bprevious", opts) - --- Insert -- --- Press jk fast to enter -keymap("i", "jk", "", opts) - --- Visual -- --- Stay in indent mode -keymap("v", "<", "", ">gv", opts) - --- Move text up and down -keymap("v", "", ":m .+1==", opts) -keymap("v", "", ":m .-2==", opts) -keymap("v", "p", '"_dP', opts) - --- Visual Block -- --- Move text up and down -keymap("x", "J", ":move '>+1gv-gv", opts) -keymap("x", "K", ":move '<-2gv-gv", opts) -keymap("x", "", ":move '>+1gv-gv", opts) -keymap("x", "", ":move '<-2gv-gv", opts) diff --git a/lua/settings/options.lua b/lua/settings/options.lua deleted file mode 100644 index 65a4143..0000000 --- a/lua/settings/options.lua +++ /dev/null @@ -1,48 +0,0 @@ --- Sets options in neovim - -local options = { - backup = false, -- creates a backup file - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - cmdheight = 2, -- more space in the neovim command line for displaying messages - completeopt = { "menuone", "noselect" }, -- mostly just for cmp - conceallevel = 0, -- so that `` is visible in markdown files - fileencoding = "utf-8", -- the encoding written to a file - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - mouse = "", -- disable the mouse to be used in neovim - pumheight = 10, -- pop up menu height - showmode = false, -- we don't need to see things like -- INSERT -- anymore - showtabline = 2, -- always show tabs - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - splitbelow = true, -- force all horizontal splits to go below current window - splitright = true, -- force all vertical splits to go to the right of current window - swapfile = false, -- creates a swapfile - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undo - updatetime = 300, -- faster completion (4000ms default) - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - expandtab = true, -- convert tabs to spaces - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, -- highlight the current line - number = true, -- set numbered lines - relativenumber = true, -- set relative numbered lines - numberwidth = 4, -- set number column width to 2 {default 4} - signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time - wrap = false, -- display lines as one long line - scrolloff = 8, -- is one of my fav - sidescrolloff = 8, - guifont = "monospace:h17", -- the font used in graphical neovim applications -} - -vim.opt.shortmess:append "c" - -for k, v in pairs(options) do - vim.opt[k] = v -end - -vim.cmd "set whichwrap+=<,>,[,],h,l" -vim.cmd [[set iskeyword+=-]] -vim.cmd [[set formatoptions-=cro]] -- cgit v1.2.3-70-g09d2 From 2093f439c0169f9155e48506b4b5444e76ee63be Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:27:40 +0200 Subject: chore(install): remove lua installer --- lua/install.lua | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 lua/install.lua diff --git a/lua/install.lua b/lua/install.lua deleted file mode 100644 index b362913..0000000 --- a/lua/install.lua +++ /dev/null @@ -1,55 +0,0 @@ --- Installs plugins with packer. - -local fn = vim.fn -local plugins = require "plugins" - --- Automatically install packer -local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system { - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - } - print "Installing packer close and reopen Neovim..." - vim.cmd [[packadd packer.nvim]] -end - --- Autocommand that reloads neovim whenever you save the plugins.lua file -vim.cmd [[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source | PackerSync - augroup end -]] - --- Use a protected call so we don't error out on first use -local status_ok, packer = pcall(require, "packer") -if not status_ok then - return -end - --- Have packer use a popup window -packer.init { - display = { - open_fn = function() - return require("packer.util").float { border = "rounded" } - end, - }, -} - --- Install your plugins here -return packer.startup(function(use) - for _, plugin in ipairs(plugins) do - use(plugin) - end - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if PACKER_BOOTSTRAP then - require("packer").sync() - end -end) -- cgit v1.2.3-70-g09d2 From 80590ded756588960e90050fc328f0bd2b9e5692 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:27:59 +0200 Subject: chore(plugins): remove lua plugins table --- lua/plugins.lua | 70 --------------------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 lua/plugins.lua diff --git a/lua/plugins.lua b/lua/plugins.lua deleted file mode 100644 index 8c4a287..0000000 --- a/lua/plugins.lua +++ /dev/null @@ -1,70 +0,0 @@ --- List of plugins - -return { - -- Base - { "wbthomason/packer.nvim" }, -- Have packer manage itself - { "nvim-lua/popup.nvim" }, -- An implementation of the Popup API from vim in Neovim - { "nvim-lua/plenary.nvim" }, -- Useful lua functions used ny lots of plugins - - -- Colorschemes - { "aktersnurra/no-clown-fiesta.nvim" }, - - -- LSP - { "hrsh7th/nvim-cmp" }, -- The completion plugin - { "hrsh7th/cmp-buffer" }, -- buffer completions - { "hrsh7th/cmp-path" }, -- path completions - { "hrsh7th/cmp-cmdline" }, -- cmdline completions - { "saadparwaiz1/cmp_luasnip" }, -- snippet completions - { "hrsh7th/cmp-nvim-lsp" }, - { "neovim/nvim-lspconfig" }, - { "williamboman/nvim-lsp-installer" }, - { "tamago324/nlsp-settings.nvim" }, - { "jose-elias-alvarez/null-ls.nvim" }, - - -- Snippets - { "L3MON4D3/LuaSnip" }, - { "rafamadriz/friendly-snippets" }, - - -- Telescope - { "nvim-telescope/telescope.nvim", requires = { { "nvim-lua/plenary.nvim" } } }, - { "nvim-telescope/telescope-fzf-native.nvim", run = "make" }, - { "nvim-telescope/telescope-file-browser.nvim" }, - - -- Treesitter - { - "nvim-treesitter/nvim-treesitter", - run = ":TSUpdate", - }, - { "JoosepAlviste/nvim-ts-context-commentstring" }, - { "nvim-treesitter/playground" }, - - -- Miscellaneous plugins - { "windwp/nvim-autopairs" }, - { "numToStr/Comment.nvim" }, - { "lewis6991/gitsigns.nvim" }, - { "kyazdani42/nvim-web-devicons" }, - { "kyazdani42/nvim-tree.lua" }, - { "akinsho/bufferline.nvim" }, - { "moll/vim-bbye" }, - { - "nvim-lualine/lualine.nvim", - requires = { "kyazdani42/nvim-web-devicons", opt = true }, - }, - { "ahmedkhalf/project.nvim" }, - { "lewis6991/impatient.nvim" }, - { "goolord/alpha-nvim" }, - { "antoinemadec/FixCursorHold.nvim" }, -- This is needed to fix lsp doc highlight - { "folke/which-key.nvim" }, - { "folke/zen-mode.nvim" }, - { "windwp/nvim-spectre" }, - { "phaazon/hop.nvim" }, - { - "kevinhwang91/nvim-bqf", - event = "BufRead", - }, - { "norcalli/nvim-colorizer.lua" }, - { "nvim-orgmode/orgmode" }, - - -- Fennel with clojure-like lisp - { "Olical/aniseed" }, -} -- cgit v1.2.3-70-g09d2 From a7caba6a6c754469204022bf155204c680e57d65 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:28:18 +0200 Subject: feat(bootstrap): add bootstrap script --- lua/bootstrap.lua | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lua/bootstrap.lua diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua new file mode 100644 index 0000000..6e49324 --- /dev/null +++ b/lua/bootstrap.lua @@ -0,0 +1,50 @@ +-- Bootstrap nvim with essential plugins. + +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command + +local function ensure(user, repository) + local packer_path = fn.stdpath "data" .. "/site/pack" + local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute(fmt("!git clone --depth 1 https://github.com/%s/%s %s", user, repository, ensure_path)) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") + +local status_ok, packer = pcall(require, "packer") +if not status_ok then + return +end + +-- Have packer use a popup window +packer.init { + display = { + open_fn = function() + return require("packer.util").float { border = "rounded" } + end, + }, +} + +-- Autocommand that reloads neovim whenever plugins.fnl file is saved +vim.cmd [[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins.fnl source | PackerCompile + augroup end +]] + +-- Enable faster loading with impatient +require "impatient" + +-- Load fennel config +vim.g["aniseed#env"] = { + module = "init", + compile = true +} -- cgit v1.2.3-70-g09d2 From d4fbb03b40657c0036652eef571256a173ab00e4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:28:43 +0200 Subject: refactor: init config --- init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init.lua b/init.lua index bdd6e6c..2c2e9e8 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,3 @@ -- Loads plugins for Neovim. -require "settings" -require "install" -require "config" +require "bootstrap" -- cgit v1.2.3-70-g09d2 From 3afce7de56161994dec3e33518f0ccdc0e082331 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 01:50:45 +0200 Subject: feat(util): safe loading of plugin --- fnl/util.fnl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fnl/util.fnl diff --git a/fnl/util.fnl b/fnl/util.fnl new file mode 100644 index 0000000..ae52bac --- /dev/null +++ b/fnl/util.fnl @@ -0,0 +1,10 @@ +;; Utility functions. +(module util) + +(defn load-plugin [name] + (let [(ok? val-or-err) (pcall require name)] + (when ok? + (val-or-err)) + (when (not ok?) + (print "Could not load config: " val-or-err)))) + -- cgit v1.2.3-70-g09d2 From 0254669b97bfb503a407d5203cb773a87adc5e36 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:06:28 +0200 Subject: feat(alpha): add fnl config --- fnl/config/alpha.fnl | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 fnl/config/alpha.fnl diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl new file mode 100644 index 0000000..b1ad907 --- /dev/null +++ b/fnl/config/alpha.fnl @@ -0,0 +1,42 @@ +;; A customizable greeter. +(module config.alpha + {autoload {util util}}) + +(def- ascii-art { + " ##############..... ############## ", + " ##############......############## ", + " ##########..........########## ", + " ##########........########## ", + " ##########.......########## ", + " ##########.....##########.. ", + " ##########....##########..... ", + " ..##########..##########......... ", + " ....##########.#########............. ", + " ..################JJJ............ ", + " ################............. ", + " ##############.JJJ.JJJJJJJJJJ ", + " ############...JJ...JJ..JJ JJ ", + " ##########....JJ...JJ..JJ JJ ", + " ########......JJJ..JJJ JJJ JJJ ", + " ###### ......... ", + " ..... ", + " . ", +}) + +(let [(ok? alpha) util.load-plugin :alpha] + (when ok? + (let [dashboard (require :alpha.themes.dashboard)] + (dashboard.section.header.val ascii-art) + (dashboard.section.buttons.val { + (dashboard.button "f" " Find file" ":Telescope file_browser ") + (dashboard.button "e" " New file" ":ene startinsert ") + (dashboard.button "p" " Find project" ":Telescope projects ") + (dashboard.button "r" " Recently used files" ":Telescope oldfiles ") + (dashboard.button "t" " Find text" ":Telescope live_grep ") + (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") + (dashboard.button "q" " Quit Neovim" ":qa") + } + (dashboard.section.header.opts.hl :AlphaHeader) + (dashboard.section.buttons.opts.hl :AlphaButtons) + (dashboard.opts.opts.noautocmd true) + (alpha.setup {dashboard.opts}))))) -- cgit v1.2.3-70-g09d2 From 2f5d72227b27d34a5466e52cf7a900c18ebdd2d5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:21:58 +0200 Subject: feat(autopairs): add fnl config --- fnl/config/autopairs.fnl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 fnl/config/autopairs.fnl diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl new file mode 100644 index 0000000..289db34 --- /dev/null +++ b/fnl/config/autopairs.fnl @@ -0,0 +1,26 @@ +;; Autopairs for brackets and quote symbols. +(module config.autopairs + {autoload {util util}}) + +(let [(ok? npairs) util.load-plugin :nvim-autopairs] + (when ok? + (npairs.setup { + :check_ts true + :ts_config { + :lua [ :string :source ] + :javascript [ :string :template_string ] + :java false + } + :disable_filetype [ :TelescopePrompt :spectre_panel ] + :fast_warp { + :map "" + :chars [ "{" "[" "(" '"' "'" ] + :pattern string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", "") + :check_comma true + :highlight :PmenuSel + :highlight_grey :LineNr + :offset 0 + :end_key $ + :keys qwertyuiopzxcvbnmasdfghjkl + :highlight PmenuSel + :highlight_grey LineNr}})) -- cgit v1.2.3-70-g09d2 From 81dce587f968f58cbb6ca74cc9a57a7bef9b56c8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:22:10 +0200 Subject: feat(bufferline): add fnl config --- fnl/config/bufferline.fnl | 118 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 fnl/config/bufferline.fnl diff --git a/fnl/config/bufferline.fnl b/fnl/config/bufferline.fnl new file mode 100644 index 0000000..0b89170 --- /dev/null +++ b/fnl/config/bufferline.fnl @@ -0,0 +1,118 @@ +;; Topbar that displays open buffers. +(module config.bufferline + {autoload {util util}}) + +(def- options + {:numbers "none" + :close_command "Bdelete! %d" + :right_mouse_command nil + :left_mouse_command nil + :middle_mouse_command nil + :indicator_icon "" + :buffer_close_icon "" + :modified_icon "●" + :close_icon "" + :left_trunc_marker "<" + :right_trunc_marker ">" + :max_name_length 30 + :max_prefix_length 30 + :tab_size 21 + :diagnostics false + :diagnostics_update_in_insert false + :offsets { { :filetype "NvimTree" :text "" :padding 1 } } + :show_buffer_icons false + :show_buffer_close_icons false + :show_close_icon false + :show_tab_indicators false + :persist_buffer_sort true + :separator_style "thin" + :enforce_regular_tabs true + :always_show_bufferline true}) + +(def- default-bg-tabline { + :attribute "bg" :highlight "TabLine"}) + +(def- default-bg-normal { + :attribute "bg" :highlight "Normal"}) + +(def- default-fg-tabline { + :attribute "fg" :highlight "TabLine"}) + +(def- default-fg-normal { + :attribute "fg" :highlight "Normal"}) + +(def- highlights + {:fill { + :guifg { :attribute "fg" :highlight "#ff0000" } + :guibg default-bg-tabline + } + :background { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :buffer_visible { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :close_button { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :close_button_visible { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :tab_selected { + :guifg default-fg-normal + :guibg default-bg-normal + } + :tab { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :tab_close { + :guifg { :attribute "fg" :highlight "TabLineSel" } + :guibg default-bg-normal + } + :duplicate_selected { + :guifg { :attribute "fg" :highlight "TabLineSel" } + :guibg { :attribute "bg" :highlight "TabLineSel" } + :gui "italic" + } + :duplicate_visible { + :guifg default-fg-tabline + :guibg default-bg-tabline + :gui "italic" + } + :duplicate { + :guifg default-fg-tabline + :guibg default-bg-tabline + :gui "italic" + } + :modified { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :modified_selected { + :guifg default-fg-normal + :guibg default-bg-normal + } + :modified_visible { + :guifg default-fg-tabline + :guibg default-bg-tabline + } + :separator { + :guifg default-bg-tabline + :guibg default-bg-tabline + } + :separator_selected { + :guifg default-bg-normal + :guibg default-bg-normal + } + :indicator_selected { + :guifg { :attribute "fg" :highlight "LspDiagnosticsDefaultHint" } + :guibg default-bg-normal}}) + +(let [(ok? bufferline) util.load-plugin :bufferline] + (when ok? + (bufferline.setup {:options options :highlights highlights}))) -- cgit v1.2.3-70-g09d2 From ffc0a822e4fe8e61eef703b59a8abbe06ca5a06c Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:22:20 +0200 Subject: feat(cmp): add fnl config --- fnl/config/cmp.fnl | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 fnl/config/cmp.fnl diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl new file mode 100644 index 0000000..a9163a1 --- /dev/null +++ b/fnl/config/cmp.fnl @@ -0,0 +1,47 @@ +;; Configuration for completion plugin. +(module config.cmp + {autoload {nvim aniseed.nvim + util util}}) + +(local luasnip (let [(ok? luasnip) util.load-plugin :luasnip] + (when ok? + ((require :luasnip/loaders/from_vscode).lazy_load) + luasnip))) + +(local lspkind (let [(ok? lspkind) util.load-plugin :lspkind] + (when ok? + lspkind))) + +(lspkind.init) + +(defn- snip [args] + (luasnip.lsp_expand args.body) + +(let [(ok? cmp) util.load-plugin :cmp] + (when ok? + (cmp.setup { + :snippet { + :expand snip} + :mapping { + "" (cmp.mapping.select_prev_item) + "" (cmp.mapping.select_next_item)} + :sources [ + {:name "nvim_lsp"} + {:name "nvim_lua"} + {:name "luasnip"} + {:name "buffer" :keyword_length 4} + {:name "path" :keyword_length 6}] + :formatting {:format (lspkind.cmp_format { + :with_text true + :menu { + :buffer "[Buf]" + :nvim_lsp "[LSP]" + :nvim_lua "[api]" + :path "[path]" + :luasnip "[Snip]" + }})} + :documentation { + :border [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]} + :experimental { + :ghost_text false + :native_menu false}}))) -- cgit v1.2.3-70-g09d2 From b587ece93c36d60bedbcab74b627929877320fc1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:22:29 +0200 Subject: feat(colorizer): add fnl config --- fnl/config/colorizer.fnl | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 fnl/config/colorizer.fnl diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl new file mode 100644 index 0000000..bd61740 --- /dev/null +++ b/fnl/config/colorizer.fnl @@ -0,0 +1,8 @@ +;; Enables colorization of color codes in source files. +(module config.colorizer + {autoload {util util}}) + +(let [(ok? colorizer) util.load-plugin :colorizer] + (when ok? + (colorizer.setup))) + -- cgit v1.2.3-70-g09d2 From da8fcbe90cd5983c0c8f1cd0cd2db8066be2f910 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:22:40 +0200 Subject: feat(colorscheme): add fnl config --- fnl/config/colorscheme.fnl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 fnl/config/colorscheme.fnl diff --git a/fnl/config/colorscheme.fnl b/fnl/config/colorscheme.fnl new file mode 100644 index 0000000..31323d7 --- /dev/null +++ b/fnl/config/colorscheme.fnl @@ -0,0 +1,9 @@ +;; Load neovim colorscheme. +(module config.colorscheme + {autoload {util util}}) + +(local colorscheme "no-clown-fiesta") + +(let [(ok? _) (pcall (.. "colorscheme " colorscheme))] + (when (not ok?) + (vim.notify (.. "colorscheme " colorscheme " not found!")))) -- cgit v1.2.3-70-g09d2 From 7b10b6088138840ac46c3fd9b1246f451c4bb8bd Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:22:50 +0200 Subject: feat(impatient): add fnl config --- fnl/config/impatient.fnl | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 fnl/config/impatient.fnl diff --git a/fnl/config/impatient.fnl b/fnl/config/impatient.fnl new file mode 100644 index 0000000..993cf82 --- /dev/null +++ b/fnl/config/impatient.fnl @@ -0,0 +1,8 @@ +;; Speeds up loading of plugins. +(module config.impatient + {autoload {util util}}) + +(let [(ok? impatient) util.load-plugin :impatient] + (when ok? + (impatient.enable_profile))) + -- cgit v1.2.3-70-g09d2 From 4a84ab7258c1352127afa2d85b8a03c29f269f48 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:23:05 +0200 Subject: feat(packer): add fnl config --- fnl/config/packer.fnl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 fnl/config/packer.fnl diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl new file mode 100644 index 0000000..ccc9ad8 --- /dev/null +++ b/fnl/config/packer.fnl @@ -0,0 +1,9 @@ +;; Load packer config +(module config.packer + {autoload {util util}}) + +(let [(ok? packer) util.load-plugin :packer] + (when ok? + (packer.init { + :display { + :open_fn (fn [] ((require :packer.util).float {:border :rounded}))}}))) -- cgit v1.2.3-70-g09d2 From 588521401a2a8b2f81cee4c2994c1e1215de6970 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:23:20 +0200 Subject: fix(settings): update --- fnl/settings/init.fnl | 7 +++---- fnl/settings/options.fnl | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl index 0045fc2..5c21629 100644 --- a/fnl/settings/init.fnl +++ b/fnl/settings/init.fnl @@ -1,5 +1,4 @@ ;; Load nvim settings -(module settings) - -(require :settings.options) -(require :settings.keymaps) +(module settings + {require {_ settings.options + _ settings.keymaps}}) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 9cf42e5..112dc2b 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -42,11 +42,10 @@ (defn- apply-opts [opts] (each [k v (pairs opts)] - (set vim.opt[k] v))) + (set vim.opt[k] v))) (set vim.cmd "set whichwrap+=<,>,[,],h,l") (set vim.cmd [[set iskeyword+=-]]) (set vim.cmd [[set formatoptions-=cro]]) (nvim.ex.set "shortmess+=c") -(nvim.ex.set :spell) (apply-opts) -- cgit v1.2.3-70-g09d2 From 62ff69d2f92fc8cf021a485085347ce4d34c308a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:23:41 +0200 Subject: feat(bootstrap): add fnl script --- fnl/bootstrap.fnl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 fnl/bootstrap.fnl diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl new file mode 100644 index 0000000..6d8ff81 --- /dev/null +++ b/fnl/bootstrap.fnl @@ -0,0 +1,28 @@ +;; Bootstraping for fresh install +(module bootstrap + {autoload {util util}}) + +(defn- fmt [s ...] + (string.format s ...)) + +(def- packer-path + (.. (vim.fn.stdpath :data) :site/pack)) + +(def- git-clone-url + ("!git clone --depth 1 https://github.com/%s/%s %s")) + +(defn- execute [cmd] + (vim.api.nvim_command cmd)) + +(defn- ensure-path [packer-path repository] + (fmt "%s/packer/start/%s" packer-path repository)) + +(defn- ensure [user repository] + (let [path (ensure-path packer-path repository)]) + (if (> (vim.fn.empty (vim.fn.glob path) 0)) + (execute (fmt git-clone-url user repository path)) + (execute (fmt "packadd %s" repository)))) + +(ensure :wbthomason :packer.nvim) +(ensure :Olical :aniseed) +(ensure :lewis6991 :impatient.nvim) -- cgit v1.2.3-70-g09d2 From d08d26c8f018af89649004b397352cf24a97aaee Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:24:03 +0200 Subject: feat(init): add fnl init --- fnl/init.fnl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index 96c1aed..7f5089b 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,6 +1,5 @@ ;; Install, load settings, and load plugin configs. (module init - {require { - _ install - _ settings - _ config}}) + {require {_ install + _ settings + _ config}}) -- cgit v1.2.3-70-g09d2 From f7a4339bc19bc6c2fb616faa43b879c5e145aa91 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:25:44 +0200 Subject: fix(install): add fnl script --- fnl/install.fnl | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 33453ef..95b2c07 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -3,20 +3,12 @@ {autoload { a aniseed.core plugins plugins - packer packer - nvim aniseed.nvim}}) + packer packer}}) -(defn- use [...] - (let [plugins [...]] - (packer.startup - (fn [use]) -) +(defn- install-plugins [...] + (each [plugin opts (pairs [...])] + (packer.startup ( + fn [use] + (use (a.assoc opts 1 plugin)))))) -(defn- override-use [use] - (fn [plugin opts] - (use (a.assoc (or opts {}) 1 name)) -) - -(packer.startup( - fn use -)) +(install-plugins plugins) -- cgit v1.2.3-70-g09d2 From 89388d10d0eae75f488974e868dd3b2c8c67432f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:26:25 +0200 Subject: refactor(plugins): table --- fnl/plugins.fnl | 118 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 58 insertions(+), 60 deletions(-) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index f3fac1c..9203532 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -2,63 +2,61 @@ (module plugins) (def plugins -{ - :wbthomason/packer.nvim {} ;; Have packer manage itself - :lewis6991/impatient.nvim {} - :Olical/aniseed {} - - :nvim-lua/popup.nvim {} ;; An implementation of the Popup API from vim in Neovim - :nvim-lua/plenary.nvim {} ;; Useful lua functions used ny lots of plugins - - ;; Colorschemes - "aktersnurra/no-clown-fiesta.nvim" {} - - ;; LSP - :hrsh7th/nvim-cmp {} ;; The completion plugin - :hrsh7th/cmp-buffer {} ;; buffer completions - :hrsh7th/cmp-path {} ;; path completions - :hrsh7th/cmp-cmdline {} ;; cmdline completions - :saadparwaiz1/cmp_luasnip {} ;; snippet completions - :hrsh7th/cmp-nvim-lsp {} - :neovim/nvim-lspconfig {} - :williamboman/nvim-lsp-installer {} - :tamago324/nlsp-settings.nvim {} - :jose-elias-alvarez/null-ls.nvim {} - - ;; Snippets - :L3MON4D3/LuaSnip {} - :rafamadriz/friendly-snippets {} - - ;; Telescope - :nvim-telescope/telescope.nvim { :requires "nvim-lua/plenary.nvim" } - :nvim-telescope/telescope-fzf-native.nvim { :run "make" } - :nvim-telescope/telescope-file-browser.nvim {} - - ;; Treesitter - :nvim-treesitter/nvim-treesitter { :run ":TSUpdate" } - :JoosepAlviste/nvim-ts-context-commentstring {} - :nvim-treesitter/playground {} - - ;; Miscellaneous plugins - :windwp/nvim-autopairs {} - :numToStr/Comment.nvim {} - :lewis6991/gitsigns.nvim {} - :kyazdani42/nvim-web-devicons {} - :kyazdani42/nvim-tree.lua {} - :akinsho/bufferline.nvim {} - :moll/vim-bbye {} - - :nvim-lualine/lualine.nvim { :requires "kyazdani42/nvim-web-devicons" :opt true }} - :ahmedkhalf/project.nvim {} - :goolord/alpha-nvim {} - :antoinemadec/FixCursorHold.nvim {} ;; This is needed to fix lsp doc highlight - :folke/which-key.nvim {} - :folke/zen-mode.nvim {} - :windwp/nvim-spectre {} - :phaazon/hop.nvim {} - - :kevinhwang91/nvim-bqf { :event "BufRead" } - :norcalli/nvim-colorizer.lua {} - :nvim-orgmode/orgmode {} - } -) + {:wbthomason/packer.nvim {} ;; Have packer manage itself + :lewis6991/impatient.nvim {} + :Olical/aniseed {} + + :nvim-lua/popup.nvim {} ;; An implementation of the Popup API from vim in Neovim + :nvim-lua/plenary.nvim {} ;; Useful lua functions used ny lots of plugins + + ;; Colorschemes + "aktersnurra/no-clown-fiesta.nvim" {} + + ;; LSP + :hrsh7th/nvim-cmp {} ;; The completion plugin + :hrsh7th/cmp-buffer {} ;; buffer completions + :hrsh7th/cmp-path {} ;; path completions + :hrsh7th/cmp-cmdline {} ;; cmdline completions + :saadparwaiz1/cmp_luasnip {} ;; snippet completions + :onsails:lspkind-nvim {} + :hrsh7th/cmp-nvim-lsp {} + :neovim/nvim-lspconfig {} + :williamboman/nvim-lsp-installer {} + :tamago324/nlsp-settings.nvim {} + :jose-elias-alvarez/null-ls.nvim {} + + ;; Snippets + :L3MON4D3/LuaSnip {} + :rafamadriz/friendly-snippets {} + + ;; Telescope + :nvim-telescope/telescope.nvim { :requires "nvim-lua/plenary.nvim" } + :nvim-telescope/telescope-fzf-native.nvim { :run "make" } + :nvim-telescope/telescope-file-browser.nvim {} + + ;; Treesitter + :nvim-treesitter/nvim-treesitter { :run ":TSUpdate" } + :JoosepAlviste/nvim-ts-context-commentstring {} + :nvim-treesitter/playground {} + + ;; Miscellaneous plugins + :windwp/nvim-autopairs {} + :numToStr/Comment.nvim {} + :lewis6991/gitsigns.nvim {} + :kyazdani42/nvim-web-devicons {} + :kyazdani42/nvim-tree.lua {} + :akinsho/bufferline.nvim {} + :moll/vim-bbye {} + + :nvim-lualine/lualine.nvim { :requires "kyazdani42/nvim-web-devicons" :opt true }} + :ahmedkhalf/project.nvim {} + :goolord/alpha-nvim {} + :antoinemadec/FixCursorHold.nvim {} ;; This is needed to fix lsp doc highlight + :folke/which-key.nvim {} + :folke/zen-mode.nvim {} + :windwp/nvim-spectre {} + :phaazon/hop.nvim {} + + :kevinhwang91/nvim-bqf { :event "BufRead" } + :norcalli/nvim-colorizer.lua {} + :nvim-orgmode/orgmode {}}) -- cgit v1.2.3-70-g09d2 From ffc1dfc4fd0d6eb50b5a5ac9b598718a1f1070c4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:26:47 +0200 Subject: fix(init): add fnl init to lua init --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2c2e9e8..4058650 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,9 @@ -- Loads plugins for Neovim. -require "bootstrap" +-- Load fennel config +vim.g["aniseed#env"] = { + module = "init", + compile = true +} + +require "init" -- cgit v1.2.3-70-g09d2 From 2b9cd52b56bfb6a76a92abb54510192472eabc24 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:48:50 +0200 Subject: fix(bootstrap): load packer and impatient --- fnl/bootstrap.fnl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index 6d8ff81..89bd5df 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -8,8 +8,7 @@ (def- packer-path (.. (vim.fn.stdpath :data) :site/pack)) -(def- git-clone-url - ("!git clone --depth 1 https://github.com/%s/%s %s")) +(def- git-clone-url "!git clone --depth 1 https://github.com/%s/%s %s") (defn- execute [cmd] (vim.api.nvim_command cmd)) @@ -26,3 +25,6 @@ (ensure :wbthomason :packer.nvim) (ensure :Olical :aniseed) (ensure :lewis6991 :impatient.nvim) + +(config.packer) +(config.impatient) -- cgit v1.2.3-70-g09d2 From 6890ddc4d7ed18859197db774ba2ea44b7031596 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:33:06 +0200 Subject: fix(alpha): add do --- fnl/config/alpha.fnl | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index b1ad907..651fec5 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -26,17 +26,18 @@ (let [(ok? alpha) util.load-plugin :alpha] (when ok? (let [dashboard (require :alpha.themes.dashboard)] - (dashboard.section.header.val ascii-art) - (dashboard.section.buttons.val { - (dashboard.button "f" " Find file" ":Telescope file_browser ") - (dashboard.button "e" " New file" ":ene startinsert ") - (dashboard.button "p" " Find project" ":Telescope projects ") - (dashboard.button "r" " Recently used files" ":Telescope oldfiles ") - (dashboard.button "t" " Find text" ":Telescope live_grep ") - (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") - (dashboard.button "q" " Quit Neovim" ":qa") - } - (dashboard.section.header.opts.hl :AlphaHeader) - (dashboard.section.buttons.opts.hl :AlphaButtons) - (dashboard.opts.opts.noautocmd true) - (alpha.setup {dashboard.opts}))))) + (do + (dashboard.section.header.val ascii-art) + (dashboard.section.buttons.val { + (dashboard.button "f" " Find file" ":Telescope file_browser ") + (dashboard.button "e" " New file" ":ene startinsert ") + (dashboard.button "p" " Find project" ":Telescope projects ") + (dashboard.button "r" " Recently used files" ":Telescope oldfiles ") + (dashboard.button "t" " Find text" ":Telescope live_grep ") + (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") + (dashboard.button "q" " Quit Neovim" ":qa") + } + (dashboard.section.header.opts.hl :AlphaHeader) + (dashboard.section.buttons.opts.hl :AlphaButtons) + (dashboard.opts.opts.noautocmd true) + (alpha.setup {dashboard.opts})))))) -- cgit v1.2.3-70-g09d2 From 54bc640e1c4df9b9481e7cbec7b684a197b07db1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:33:32 +0200 Subject: feat(better-escape): add fnl config --- fnl/config/better-escape.fnl | 12 ++++++++++++ fnl/plugins.fnl | 1 + 2 files changed, 13 insertions(+) create mode 100644 fnl/config/better-escape.fnl diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl new file mode 100644 index 0000000..83b4d07 --- /dev/null +++ b/fnl/config/better-escape.fnl @@ -0,0 +1,12 @@ +;; Better escape without nasty delay +(module config.better-escape + {autoload {util util}}) + + +(let [(ok? better-escape) util.load-plugin :better-escape] + (when ok? + (better-escape.setup { + :mapping ["jk" "jj"] + :timeout vim.o.timeoutlen + :clear_empty_lines false + :keys ""}}))) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 9203532..1772fbb 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -59,4 +59,5 @@ :kevinhwang91/nvim-bqf { :event "BufRead" } :norcalli/nvim-colorizer.lua {} + :max397574/better-escape.nvim {} :nvim-orgmode/orgmode {}}) -- cgit v1.2.3-70-g09d2 From 9b09bddfb8223f3b2f5d65a6d2af2e851bb3bbd1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:33:50 +0200 Subject: fix(bootstrap): add require for packer and impatient --- fnl/bootstrap.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index 89bd5df..4434003 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -26,5 +26,5 @@ (ensure :Olical :aniseed) (ensure :lewis6991 :impatient.nvim) -(config.packer) -(config.impatient) +(require :config.packer) +(require :config.impatient) -- cgit v1.2.3-70-g09d2 From 36c268d612b48f950e3add4fd625cadb508e881b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:34:06 +0200 Subject: fix(keymap): remove jk esc --- fnl/settings/keymaps.fnl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index b6c826a..70f8896 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -37,10 +37,6 @@ (map "n" "" ":bnext" opts) (map "n" "" ":bprevious" opts) -;; Insert ;; -;; Press jk fast to enter -(map "i" "jk" "" opts) - ;; Visual ;; ;; Stay in indent mode (map "v" "<" " Date: Mon, 4 Apr 2022 22:34:20 +0200 Subject: style(packer): format --- fnl/config/packer.fnl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl index ccc9ad8..0bd8aef 100644 --- a/fnl/config/packer.fnl +++ b/fnl/config/packer.fnl @@ -6,4 +6,5 @@ (when ok? (packer.init { :display { - :open_fn (fn [] ((require :packer.util).float {:border :rounded}))}}))) + :open_fn (fn [] + ((require :packer.util).float {:border :rounded}))}}))) -- cgit v1.2.3-70-g09d2 From 06706aeca06432e77bebe95ad1aaf0606d9863e6 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:34:52 +0200 Subject: feat(orgmode): add fnl config --- fnl/config/orgmode.fnl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fnl/config/orgmode.fnl diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl new file mode 100644 index 0000000..ceea169 --- /dev/null +++ b/fnl/config/orgmode.fnl @@ -0,0 +1,17 @@ +;; Orgmode for nvim. +(module config.orgmode + {autoload {util util}}) + +(let [(ok? orgmode) util.load-plugin :orgmode] + (when ok? + (do + (orgmode.setup_ts_grammar) + (orgmode.setup + {:org_agenda_files { "~/.local/share/org/**/*" } + :org_default_notes_file "~/.local/share/org/refile.org" + :org_agenda_templates { + :t { :description "Task" :template "* TODO %?\n %u" } + :m { + :description "Meeting" + :template "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:"} + :n { :description "Note" :template "* NOTE %? :NOTE:\n %u" }}})))) -- cgit v1.2.3-70-g09d2 From 6aebac1fcb09417388d96c28d55cbf69b58b940c Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:35:06 +0200 Subject: feat(nvim-tree): add fnl config --- fnl/config/nvim-tree.fnl | 105 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 fnl/config/nvim-tree.fnl diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl new file mode 100644 index 0000000..b2f3ca2 --- /dev/null +++ b/fnl/config/nvim-tree.fnl @@ -0,0 +1,105 @@ +;; A file explorer. +(module config.nvim-tree + {autoload {util util + nvim aniseed.nvim}}) + +(set nvim.g.nvim_tree_show_icons + {:default "" + :symlink "" + :git { + :unstaged "" + :staged "S" + :unmerged "" + :renamed "➜" + :deleted "" + :untracked "U" + :ignored "◌" + } + :folder { + :default "" + :open "" + :empty "" + :empty_open "" + :symlink ""}}) + +(let [(ok? nvim-tree) util.load-plugin :nvim-tree (_ nvim-tree-config) util.load-plugin :nvim-tree.config] + (when ok? + (let [tree-cb nvim_tree_config.nvim_tree_callback]) + (nvim-tree.setup + {:auto_reload_on_write true + :disable_netrw false + :hide_root_folder false + :hijack_cursor false + :hijack_netrw true + :hijack_unnamed_buffer_when_opening false + :ignore_buffer_on_setup false + :open_on_setup false + :open_on_tab false + :sort_by "name" + :update_cwd true + :view { + :width 30 + :height 30 + :side "left" + :preserve_window_proportions false + :number false + :relativenumber false + :signcolumn "yes" + :mappings { + :custom_only false + :list { + { :key [ "l" "" "o" ] :cb (tree_cb "edit") } + { :key "h" :cb (tree_cb "close_node") } + { :key "v" :cb (tree_cb "vsplit") }}}} + :hijack_directories { + :enable true + :auto_open true} + :update_focused_file { + :enable true + :update_cwd true + :ignore_list {}} + :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ] + :system_open { + :cmd nil + :args {}} + :diagnostics { + :enable true + :show_on_dirs false + :icons { + :hint "" + :info "" + :warning "" + :error ""}} + :filters { + :dotfiles false + :custom {} + :exclude {}} + :git { + :enable true + :ignore true + :timeout 400} + :actions { + :change_dir { + :enable true + :global false} + :open_file { + :quit_on_open false + :resize_window false + :window_picker { + :enable true + :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" + :exclude { + :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ] + :buftype [ "nofile" "terminal" "help" ]}}}} + :trash { + :cmd "trash" + :require_confirm true} + :log { + :enable false + :truncate false + :types { + :all false + :config false + :copy_paste false + :git false + :profile false}}}))) -- cgit v1.2.3-70-g09d2 From f76a4f1eb665e223be19f200336409a3de48f5bb Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:35:15 +0200 Subject: feat(comment): add fnl config --- fnl/config/ncomment.fnl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 fnl/config/ncomment.fnl diff --git a/fnl/config/ncomment.fnl b/fnl/config/ncomment.fnl new file mode 100644 index 0000000..68d4c97 --- /dev/null +++ b/fnl/config/ncomment.fnl @@ -0,0 +1,26 @@ +;; Language aware commenting. +(module config.ncomment + {autoload {util util}}) + + +(defn- get-type [ctx U] + (or (and (= ctx.ctype U.ctype.line) :__default) :__multiline)) + +(defn- get-location [ctx U] + (if (= ctx.ctype U.ctype.block) + ((require :ts_context_commentstring.utils).get_cursor_location) + (or (= ctx.motion U.motion.v) (= ctx.motion U.cmotion.V)) + ((require :ts_context_commentstring.utils).get_visual_start_location) + (nil))) + +(defn- pre-hook [ctx] + (let [U (require :Comment.utils)] + ((require :ts_context_commentstring.internal).calculate_commentstring { + :key (get-type ctx U) + :location (get-location ctx U)}))) + +(let [(ok? ncomment) util.load-plugin :Comment] + (when ok? + (ncomment.setup + {:pre_hook (fn [ctx] + (pre-hook ctx))}))) -- cgit v1.2.3-70-g09d2 From 2001cea7d87e7ef72bee11039bfe6eeeb680dd46 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:35:27 +0200 Subject: feat(lualine): add fnl config --- fnl/config/lualine.fnl | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 fnl/config/lualine.fnl diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl new file mode 100644 index 0000000..908b6d2 --- /dev/null +++ b/fnl/config/lualine.fnl @@ -0,0 +1,61 @@ +;; Statusbar. +(module config.lualine + {autoload {util util}}) + +(defn- hide-in-width [] + (> (vim.fn.winwidth 0) 80)) + +(def- diagnostics { + 1 "diagnostics" + :sources [ "nvim_diagnostic" ] + :sections [ "error" "warn" ] + :symbols { :error " " :warn " " } + :colored false + :update_in_insert false + :always_visible true}) + +(def- diff { + 1 "diff" + :colored false + :symbols { :added " " :modified " " :removed " " } + :cond hide-in-width}) + +(def- branch { + 1 "b:gitsigns_head" + :icon " " + :cond hide-in-width}) + +(def- filetype { + 1 "filetype" + :cond hide_in_width + :color {}}) + +(let [(ok? lualine) util.load-plugin :lualine] + (when ok? + (lualine.setup { + :options { + :icons_enabled true + :theme "auto" + :component_separators { :left "" :right "" } + :section_separators { :left "" :right "" } + :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ] + :always_divide_middle true + } + :sections { + :lualine_a [ "mode" ] + :lualine_b { 1 branch 2 "filename" } + :lualine_c { 1 diff } + :lualine_x { 1 diagnostics 2 filetype } + :lualine_y {} + :lualine_z [ "location" "progress" "encoding" ] + } + :inactive_sections { + :lualine_a [ "mode" ] + :lualine_b [ "filename" ] + :lualine_c {} + :lualine_x {} + :lualine_y {} + :lualine_z [ "location" "progress" "encoding" ] + } + :tabline {} + :extensions {}}))) -- cgit v1.2.3-70-g09d2 From 736430d1269dbbdc72684c671b51825a17df59f8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:35:56 +0200 Subject: feat(config init): add load of new plugins --- fnl/config/init.fnl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index e69de29..8f472f5 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -0,0 +1,14 @@ +;; Load all plugin configs. +(module config.init + {require + {_ config.alpha + _ config.autopairs + _ config.better-escape + _ config.bufferline + _ config.cmp + _ config.colorizer + _ config.colorscheme + _ config.gitsigns + _ config.lualine + _ config.ncomment + _ config.nvim-tree}}) -- cgit v1.2.3-70-g09d2 From 97d82e179f6849dbdf979f087aaf7dcca53f8430 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:36:08 +0200 Subject: style(impatient): format --- fnl/config/impatient.fnl | 1 - 1 file changed, 1 deletion(-) diff --git a/fnl/config/impatient.fnl b/fnl/config/impatient.fnl index 993cf82..06521d7 100644 --- a/fnl/config/impatient.fnl +++ b/fnl/config/impatient.fnl @@ -5,4 +5,3 @@ (let [(ok? impatient) util.load-plugin :impatient] (when ok? (impatient.enable_profile))) - -- cgit v1.2.3-70-g09d2 From 947ac0878b5a7ad99f71f5f4263ef28980215d17 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:36:19 +0200 Subject: feat(hop): add fnl config --- fnl/config/hop.fnl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 fnl/config/hop.fnl diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl new file mode 100644 index 0000000..d12c650 --- /dev/null +++ b/fnl/config/hop.fnl @@ -0,0 +1,11 @@ +;; Hopping in text. +(module config.hop + {autoload {util util + nvim aniseed.nvim}}) + +(let [(ok? hop) util.load-plugin :hop] + (when ok? + (hop.setup {}))) + +(nvim.set_keymap "n" "s" ":HopChar2" { :silent true }) +(nvim.set_keymap "n" "S" ":HopWord" { :silent true }) -- cgit v1.2.3-70-g09d2 From 53a666a21dfd8c322e15c7f3d8ffeec12be28cff Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:36:32 +0200 Subject: feat(gitsigns): add fnl config --- fnl/config/gitsigns.fnl | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 fnl/config/gitsigns.fnl diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl new file mode 100644 index 0000000..7216ad4 --- /dev/null +++ b/fnl/config/gitsigns.fnl @@ -0,0 +1,71 @@ +;; Add git signs to source files. +(module config.gitsigns + {autoload {util util}}) + +(def- signs { + add { + hl "GitSignsAdd" + text "▎" + numhl "GitSignsAddNr" + linehl "GitSignsAddLn" + } + change { + hl "GitSignsChange" + text "▎" + numhl "GitSignsChangeNr" + linehl "GitSignsChangeLn" + } + delete { + hl "GitSignsDelete" + text "契" + numhl "GitSignsDeleteNr" + linehl "GitSignsDeleteLn" + } + topdelete { + hl "GitSignsDelete" + text "契" + numhl "GitSignsDeleteNr" + linehl "GitSignsDeleteLn" + } + changedelete { + hl "GitSignsChange" + text "▎" + numhl "GitSignsChangeNr" + linehl "GitSignsChangeLn"}}) + +(let [(ok? gitsigns) util.load-plugin :gitsigns] + (when ok? + (gitsigns.setup { + :signs signs + :signcolumn true + :numhl false + :linehl false + :word_diff false + :watch_gitdir { + :interval 1000 + :follow_files true + } + :attach_to_untracked true + :current_line_blame false + :current_line_blame_opts { + :virt_text true + :virt_text_pos "eol" + :delay 1000 + :ignore_whitespace false + } + :current_line_blame_formatter_opts { + :relative_time false + } + :sign_priority 6 + :update_debounce 100 + :status_formatter nil + :max_file_length 40000 + :preview_config { + :border "single" + :style "minimal" + :relative "cursor" + :row 0 + :col 1 + } + :yadm { + :enable false}}))) -- cgit v1.2.3-70-g09d2 From 5472e82d8e43e7b75694a23ea8ee1ac1d0c93456 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:36:44 +0200 Subject: style(colorizer): format --- fnl/config/colorizer.fnl | 1 - 1 file changed, 1 deletion(-) diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl index bd61740..2e01af3 100644 --- a/fnl/config/colorizer.fnl +++ b/fnl/config/colorizer.fnl @@ -5,4 +5,3 @@ (let [(ok? colorizer) util.load-plugin :colorizer] (when ok? (colorizer.setup))) - -- cgit v1.2.3-70-g09d2 From 90db7a7e1022d7f8ec7c2259b9828d18042f1991 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Apr 2022 22:37:09 +0200 Subject: fix(cmp): add do --- fnl/config/cmp.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index a9163a1..f7e9c7b 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -5,8 +5,9 @@ (local luasnip (let [(ok? luasnip) util.load-plugin :luasnip] (when ok? - ((require :luasnip/loaders/from_vscode).lazy_load) - luasnip))) + (do + (require :luasnip/loaders/from_vscode).lazy_load) + luasnip))) (local lspkind (let [(ok? lspkind) util.load-plugin :lspkind] (when ok? -- cgit v1.2.3-70-g09d2 From f896d92a19555335d024bcc73e276196aa01db0b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:48:39 +0200 Subject: style: format --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 4058650..7defcbf 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ -- Load fennel config vim.g["aniseed#env"] = { module = "init", - compile = true + compile = true, } require "init" -- cgit v1.2.3-70-g09d2 From 8b6f090a4799f88e05262591edf528dae12a58b8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:49:05 +0200 Subject: fix(util): add if when loading plugin --- fnl/util.fnl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index ae52bac..eb706cc 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -3,8 +3,7 @@ (defn load-plugin [name] (let [(ok? val-or-err) (pcall require name)] - (when ok? - (val-or-err)) - (when (not ok?) + (if ok? + (val-or-err) (print "Could not load config: " val-or-err)))) -- cgit v1.2.3-70-g09d2 From d13d74a010ce8354eb87cad090afa85c02487aa3 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:49:16 +0200 Subject: style: format --- fnl/install.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 95b2c07..65e2b8b 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -9,6 +9,6 @@ (each [plugin opts (pairs [...])] (packer.startup ( fn [use] - (use (a.assoc opts 1 plugin)))))) + (use (a.assoc opts 1 plugin)))))) (install-plugins plugins) -- cgit v1.2.3-70-g09d2 From 0568242820c215f164ca4e8bc4be277dff07fc48 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:49:25 +0200 Subject: style(bootstrap): format --- fnl/bootstrap.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index 4434003..2665550 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -19,8 +19,9 @@ (defn- ensure [user repository] (let [path (ensure-path packer-path repository)]) (if (> (vim.fn.empty (vim.fn.glob path) 0)) - (execute (fmt git-clone-url user repository path)) - (execute (fmt "packadd %s" repository)))) + (do + (execute (fmt git-clone-url user repository path)) + (execute (fmt "packadd %s" repository))))) (ensure :wbthomason :packer.nvim) (ensure :Olical :aniseed) -- cgit v1.2.3-70-g09d2 From b09599b191b4bed698405cf8ea32a1531b09ce71 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:49:37 +0200 Subject: feat(zen): add fnl config --- fnl/config/zen.fnl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 fnl/config/zen.fnl diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl new file mode 100644 index 0000000..b1063bb --- /dev/null +++ b/fnl/config/zen.fnl @@ -0,0 +1,19 @@ +;; Zen mode. +(module config.zen-mode + {autoload {util util}}) + +(let [(ok? zen-mode) util.load-plugin :zen-mode] + (when ok? + (zen-mode.setup + {:window { + :backdrop 1 + :height 1 + :width 120 + :options { + :signcolumn "no" + :number false + :relativenumber false}} + :plugins { + :gitsigns { :enabled false } + :tmux { :enabled true } + :twilight { :enabled true }}}))) -- cgit v1.2.3-70-g09d2 From acabd03c5868f66ee857a27eef2835478d38f1d4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:49:51 +0200 Subject: feat(which-key): add fnl config --- fnl/config/which-key.fnl | 177 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 fnl/config/which-key.fnl diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl new file mode 100644 index 0000000..b9fc923 --- /dev/null +++ b/fnl/config/which-key.fnl @@ -0,0 +1,177 @@ +;; Which-key provides a pop-up meny for some key mappings. +(module config.which-key + {autoload {util util}}) + +(def- setup { + :plugins { + :marks true + :registers true + :spelling { + :enabled true + :suggestions 20} + :presets { + :operators false + :motions false + :text_objects false + :windows true + :nav true + :z true + :g true}} + :icons { + :breadcrumb "»" + :separator "" + :group "+"} + :popup_mappings { + :scroll_down "" + :scroll_up ""} + :window { + :border "rounded" + :position "bottom" + :margin [ 1 0 1 0 ] + :padding [ 2 2 2 2 ] + :winblend 0} + :layout { + :height { :min 4 :max 25 } + :width { :min 20 :max 50 } + :spacing 3 + :align "left"} + :ignore_missing true + :hidden [ "" "" "" "" "call" "lua" "^:" "^ " ] + :show_help true + :triggers "auto" + :triggers_blacklist { + :i [ "j" "k" ] + :v [ "j" "k" ]}}) + +(def- opts { + :mode "n" + :prefix "" + :buffer nil + :silent true + :noremap true + :nowait true}) + +(def- mappings { + :k [ 'lua require("Comment.api").toggle_current_linewise()' "Comment" ] + :a [ "Alpha" "Alpha" ] + :b [ + "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer false})" + "Buffers" + ] + :e [ "NvimTreeToggle" "Explorer" ] + :c [ "Bdelete!" "Close Buffer" ] + :n [ "nohlsearch" "No Highlight" ] + :f [ + "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer false})" + "Find files" + ] + :F [ "Telescope file_browser" "Browse files" ] + :t [ "Telescope live_grep theme=ivy" "Find Text" ] + :P [ "Telescope projects" "Projects" ] + :z [ "ZenMode" "Zen Mode" ] + :v [ "vsplit" "Vertical Split" ] + :h [ "split" "Horizontal Split" ] + :p { + :name "Packer" + :c [ "PackerCompile" "Compile" ] + :i [ "PackerInstall" "Install" ] + :s [ "PackerSync" "Sync" ] + :S [ "PackerStatus" "Status" ] + :u [ "PackerUpdate" "Update" ]} + :g { + :name "Git" + :g [ "lua _LAZYGIT_TOGGLE()" "Lazygit" ] + :j [ "lua require 'gitsigns'.next_hunk()" "Next Hunk" ] + :k [ "lua require 'gitsigns'.prev_hunk()" "Prev Hunk" ] + :l [ "lua require 'gitsigns'.blame_line()" "Blame" ] + :p [ "lua require 'gitsigns'.preview_hunk()" "Preview Hunk" ] + :r [ "lua require 'gitsigns'.reset_hunk()" "Reset Hunk" ] + :R [ "lua require 'gitsigns'.reset_buffer()" "Reset Buffer" ] + :s [ "lua require 'gitsigns'.stage_hunk()" "Stage Hunk" ] + :u [ + "lua require 'gitsigns'.undo_stage_hunk()" + "Undo Stage Hunk" + ] + :o [ "Telescope git_status" "Open changed file" ] + :b [ "Telescope git_branches" "Checkout branch" ] + :c [ "Telescope git_commits" "Checkout commit" ] + :d [ + "Gitsigns diffthis HEAD" + "Diff" + ]} + :l { + :name "LSP" + :a [ "lua vim.lsp.buf.code_action()" "Code Action" ] + :d [ + "Telescope lsp_document_diagnostics" + "Document Diagnostics" + ] + :w [ + "Telescope lsp_workspace_diagnostics" + "Workspace Diagnostics" + ] + :f [ "lua vim.lsp.buf.formatting()" "Format" ] + :i [ "LspInfo" "Info" ] + :I [ "LspInstallInfo" "Installer Info" ] + :j [ + "lua vim.lsp.diagnostic.goto_next()" + "Next Diagnostic" + ] + :k [ + "lua vim.lsp.diagnostic.goto_prev()" + "Prev Diagnostic" + ] + :l [ "lua vim.lsp.codelens.run()" "CodeLens Action" ] + :q [ "lua vim.lsp.diagnostic.set_loclist()" "Quickfix" ] + :r [ "lua vim.lsp.buf.rename()" "Rename" ] + :s [ "Telescope lsp_document_symbols" "Document Symbols" ] + :S [ + "Telescope lsp_dynamic_workspace_symbols" + "Workspace Symbols" + ]} + :s { + :name "Search" + :b [ "Telescope git_branches" "Checkout branch" ] + :c [ "Telescope colorscheme" "Colorscheme" ] + :h [ "Telescope help_tags" "Find Help" ] + :M [ "Telescope man_pages" "Man Pages" ] + :r [ "Telescope oldfiles" "Open Recent File" ] + :R [ "Telescope registers" "Registers" ] + :k [ "Telescope keymaps" "Keymaps" ] + :C [ "Telescope commands" "Commands" ]} + :o { + :name "Orgmode" + :a [ "lua require('orgmode').action('agenda.prompt')" "Open agenda prompt" ] + :c [ "lua require('orgmode').action('capture.prompt')" "Open capture prompt" ]} + :r { + :name "Replace" + :r [ "lua require('spectre').open()" "Replace" ] + :w [ + "lua require('spectre').open_visual({select_word=true})" + "Replace Word" + ] + :f [ "lua require('spectre').open_file_search()" "Replace Buffer" ] + } + :T { + :name "Treesitter" + :p [ "TSPlaygroundToggle" "Playground" ]}}) + +(def- vopts { + :mode "v" + :prefix "" + :buffer nil + :silent true + :noremap true + :nowait true}) + +(def- vmappings { + :k [ + 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())' + "Comment" ]}) + +(let [(ok? which-key) util.load-plugin :nvim-which-key.config] + (when ok? + (do + (which-key.setup setup) + (when.register mappings opts) + (when.register vmappings vopts)))) -- cgit v1.2.3-70-g09d2 From b579081ce4dbabcbaa334057b0a748cf2cf6ddf6 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:50:07 +0200 Subject: feat(treesitter): add fnl config --- fnl/config/treesitter.fnl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fnl/config/treesitter.fnl diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl new file mode 100644 index 0000000..cfbf00c --- /dev/null +++ b/fnl/config/treesitter.fnl @@ -0,0 +1,21 @@ +;; Treesitter is a tool for building syntax trees for source files. +;; In the neovim context it helps with better coloring. +(module config.treesitter + {autoload {util util}}) + +(let [(ok? treesitter) util.load-plugin :nvim-treesitter.config] + (when ok? + (treesitter.setup + {:ensure_installed "maintained" + :sync_install false + :ignore_install { "" } + :autopairs { :enable true } + :highlight { + :enable true + :disable [ "org" ] + :additional_vim_regex_highlighting [ "org" ]}} + :context_commentstring { + :enable true + :enable_autocmd false} + :indent { :enable true :disable [ "yaml" "python" "css" ] } + :playground { :enable true }} -- cgit v1.2.3-70-g09d2 From 769f2e1a99863e6dcf620eab6684620be8feabe3 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:50:21 +0200 Subject: feat(telescope): add fnl config --- fnl/config/telescope.fnl | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 fnl/config/telescope.fnl diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl new file mode 100644 index 0000000..86986e7 --- /dev/null +++ b/fnl/config/telescope.fnl @@ -0,0 +1,101 @@ +;; Telescope a highly extendable fuzzy finder over lists. +(module config.telescope + {autoload {util util}}) + +(let [(ok? telescope) util.load-plugin :telescope] + (when ok? + (do + (let [actions (require :telescope.actions)] + (telescope.setup { + :defaults { + :prompt_prefix " " + :selection_caret " " + :path_display [ "smart" ] + :initial_mode "insert" + :selection_strategy "reset" + :sorting_strategy "ascending" + :layout_strategy "horizontal" + :layout_config { + :prompt_position "top" + :preview_cutoff 120 + :horizontal { mirror false } + :vertical { mirror false }} + :vimgrep_arguments [ + "rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + "--hidden" + ] + :mappings { + :i { + : actions.cycle_history_next + : actions.cycle_history_prev + + : actions.move_selection_next + : actions.move_selection_previous + + : actions.close + + : actions.move_selection_next + : actions.move_selection_previous + + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab + + : actions.preview_scrolling_up + : actions.preview_scrolling_down + + : actions.results_scrolling_up + : actions.results_scrolling_down + + : (+ actions.toggle_selection actions.move_selection_worse) + : (+ actions.toggle_selection actions.move_selection_better) + : (+ actions.send_to_qflist actions.open_qflist) + : (+ actions.send_selected_to_qflist actions.open_qflist) + : actions.complete_tag + : actions.which_key} + :n { + : actions.close + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab + + : (+ actions.toggle_selection actions.move_selection_worse) + : (+ actions.toggle_selection actions.move_selection_better) + : (+ actions.send_to_qflist actions.open_qflist) + : (+ actions.send_selected_to_qflist actions.open_qflist) + + :j actions.move_selection_next + :k actions.move_selection_previous + :H actions.move_to_top + :M actions.move_to_middle + :L actions.move_to_bottom + + : actions.move_selection_next + : actions.move_selection_previous + :gg actions.move_to_top + :G actions.move_to_bottom + + : actions.preview_scrolling_up + : actions.preview_scrolling_down + + : actions.results_scrolling_up + : actions.results_scrolling_down + + :? actions.which_key}}} + :extensions { + :fzf { + :fuzzy true + :override_generic_sorter true + :override_file_sorter true + :case_mode "smart_case"}}}) + (telescope.load_extension :fzf) + (telescope.load_extension :file_browser) + (telescope.load_extension :project))))) -- cgit v1.2.3-70-g09d2 From 9285006ea4a71b3132e3ad9f8bfcdda585f7b427 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:50:32 +0200 Subject: feat(spectre): add fnl config --- fnl/config/spectre.fnl | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 fnl/config/spectre.fnl diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl new file mode 100644 index 0000000..a6df5d1 --- /dev/null +++ b/fnl/config/spectre.fnl @@ -0,0 +1,100 @@ +;; Find and replace. +(module config.spectre + {autoload {util util}}) + +(let [(ok? spectre) util.load-plugin :spectre] + (when ok? + (spectre.setup + {:color_devicons true + :highlight { + :ui "String" + :search "DiffChange" + :replace "DiffDelete"} + :mapping { + :toggle_line { + :map "t" + :cmd "lua require('spectre').toggle_line()" + :desc "toggle current item"} + :enter_file { + :map "" + :cmd "lua require('spectre.actions').select_entry()" + :desc "goto current file"} + :send_to_qf { + :map "Q" + :cmd "lua require('spectre.actions').send_to_qf()" + :desc "send all item to quickfix"} + :replace_cmd { + :map "c" + :cmd "lua require('spectre.actions').replace_cmd()" + :desc "input replace vim command"} + :show_option_menu { + :map "o" + :cmd "lua require('spectre').show_options()" + :desc "show option"} + :run_replace { + :map "R" + :cmd "lua require('spectre.actions').run_replace()" + :desc "replace all"} + :change_view_mode { + :map "m" + :cmd "lua require('spectre').change_view()" + :desc "change result view mode"} + :toggle_ignore_case { + :map "I" + :cmd "lua require('spectre').change_options('ignore-case')" + :desc "toggle ignore case"} + :toggle_ignore_hidden { + :map "H" + :cmd "lua require('spectre').change_options('hidden')" + :desc "toggle search hidden"}} + :find_engine { + :rg { + :cmd "rg" + :args [ + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column"] + :options { + :ignore-case { + :value "--ignore-case" + :icon "[I]" + :desc "ignore case"} + :hidden { + :value "--hidden" + :desc "hidden file" + :icon "[H]"}}} + :ag { + :cmd "ag" + :args [ + "--vimgrep" + "-s" + ] + :options { + :ignore-case { + :value "-i" + :icon "[I]" + :desc "ignore case"} + :hidden { + :value "--hidden" + :desc "hidden file" + :icon "[H]"}}}} + :replace_engine { + :sed { + :cmd "sed" + :args nil} + :options { + :ignore-case { + :value "--ignore-case" + :icon "[I]" + :desc "ignore case"}}} + :default { + :find { + :cmd "rg" + :options { "ignore-case" }} + :replace { + :cmd "sed"}} + :replace_vim_cmd "cdo" + :is_open_target_win true + :is_insert_mode false}) -- cgit v1.2.3-70-g09d2 From 1e9036800d30a416f1271e5422a318942abed958 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:50:43 +0200 Subject: feat(project): add fnl config --- fnl/config/project.fnl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fnl/config/project.fnl diff --git a/fnl/config/project.fnl b/fnl/config/project.fnl new file mode 100644 index 0000000..30843f8 --- /dev/null +++ b/fnl/config/project.fnl @@ -0,0 +1,16 @@ +;; Provides project management. +(module config.project + {autoload {util util}}) + +(let [(ok? project) util.load-plugin :project_nvim] + (when ok? + (project.setup + {:active true + :on_config_done nil + :manual_mode false + :detection_methods [ :patterns ] + :patterns [ :git :_darcs :.hg :.bzr :.svn :Makefile :package.json ] + :show_hidden false + :silent_chdir true + :ignore_lsp {} + :datapath (vim.fn.stdpath :data)}) -- cgit v1.2.3-70-g09d2 From d0dff620968d0666220be415ec33e80dde2d43c9 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:50:55 +0200 Subject: feat(autocmd): add fnl config --- fnl/config/autocmd.fnl | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 fnl/config/autocmd.fnl diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl new file mode 100644 index 0000000..b6a3fe4 --- /dev/null +++ b/fnl/config/autocmd.fnl @@ -0,0 +1,65 @@ +;; A customizable greeter. +(module config.autocmd + {autoload {util util + nvim aniseed.nvim + a aniseed.core}}) + +(def- group (nvim.create_autogroup :K {:clear true})) + +(defn- autocmd [name opts] + (nvim.create_autocmd name (a.merge! {:group group} opts)) + +(autocmd :FileType + {:pattern [ :qf :help :man :lspinfo ] + :command "nnoremap q :close" + :group :_general_settings}) + +(autocmd :TextYankPost + {:pattern [ :* ] + :command "silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}" + :group :_general_settings}) + +(autocmd :BufWinEnter + {:pattern [ :* ] + :command ":set formatoptions-=cro" + :group :_general_settings}) + +(autocmd :FileType + {:pattern [ :qf ] + :command "set nobuflisted" + :group :_general_settings}) + +(autocmd :FileType + {:pattern [ :gitcommit ] + :command "setlocal wrap" + :group :_git}) + +(autocmd :FileType + {:pattern [ :gitcommit ] + :command "setlocal spell" + :group :_git}) + +(autocmd :FileType + {:pattern [ :markdown ] + :command "setlocal wrap" + :group :_markdown}) + +(autocmd :FileType + {:pattern [ :markdown ] + :command "setlocal spell" + :group :_markdown}) + +(autocmd :VimResized + {:pattern [ :* ] + :command "tabdo wincmd =" + :group :_auto_resize}) + +(autocmd :User + {:pattern [ :AlphaReady ] + :command "set showtabline=0 | autocmd BufUnload set showtabline=2" + :group :_alpha}) + +(autocmd :BufWritePost + {:pattern [ :plugins.fnl ] + :command "source | PackerSync" + :group :packer_user_config}) -- cgit v1.2.3-70-g09d2 From b520b0f48f922d93ac448bbbee90b9d502c5ced8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:36:22 +0200 Subject: feat(jsonls): add fnl config --- fnl/config/lsp/settings/jsonls.fnl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fnl/config/lsp/settings/jsonls.fnl diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl new file mode 100644 index 0000000..1475fd1 --- /dev/null +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -0,0 +1,17 @@ +;; Json schema store catalog language server. +(module config.lsp.settings.jsonls + {autoload {util util}}) + +(let [(ok? schemastore) util.load-plugin :schemastore] + (when ok? + (schemastore.setup + {:init_options { + :providerFormatter false} + :settings { + :json { + :schemas (schemastore.json.schemas)}} + :setup { + :commands { + :Format { + (fn [] + (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}}))) -- cgit v1.2.3-70-g09d2 From ba5d050c1b5ae35ed88e3a53ef1d5c8ec267ef9d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:36:40 +0200 Subject: feat(pyright): add fnl config --- fnl/config/lsp/settings/pyright.fnl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fnl/config/lsp/settings/pyright.fnl diff --git a/fnl/config/lsp/settings/pyright.fnl b/fnl/config/lsp/settings/pyright.fnl new file mode 100644 index 0000000..369fa36 --- /dev/null +++ b/fnl/config/lsp/settings/pyright.fnl @@ -0,0 +1,10 @@ +;; Config for pyright language server. +(module config.lsp.settings.pyright) + +(def settings + {:settings + {:python + {:analysis + {:typeCheckingMode "off"}}}}) + +(settings) -- cgit v1.2.3-70-g09d2 From 1996d606ed56c815790baaccc2151cad5db00fc4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:36:55 +0200 Subject: feat(sumneko lua): add fnl config --- fnl/config/lsp/settings/sumneko-lua.fnl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fnl/config/lsp/settings/sumneko-lua.fnl diff --git a/fnl/config/lsp/settings/sumneko-lua.fnl b/fnl/config/lsp/settings/sumneko-lua.fnl new file mode 100644 index 0000000..5498f7e --- /dev/null +++ b/fnl/config/lsp/settings/sumneko-lua.fnl @@ -0,0 +1,21 @@ +;; Config for a Lua language server. +(module config.lsp.settings.sumneko-lua) + +(def- workspace + {:library {(vim.fn.expand "$VIMRUNTIME/lua") true + (vim.fn.expand "$VIMRUNTIME/lua/vim/lsp") true}}) + +(def- diagnostics + {:globals ["vim" "map" "filter" "range" "reduce" "head" "tail" "nth" "use" "describe" "it" "dump"]}) + +(def- runtime + {:version "LuaJIT" + :path (vim.split package.path ";")}) + +(def settings + {:settings { + :Lua { + :diagnostics diagnostics + :workspace workspace}}}) + +(settings) -- cgit v1.2.3-70-g09d2 From 8348bd80ff4e4736bdf9586148aff72ff05ff882 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:37:08 +0200 Subject: feat(handlers): wip --- fnl/config/lsp/handlers.fnl | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 fnl/config/lsp/handlers.fnl diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-70-g09d2 From cf72d636f766ba969b6ed2a560b7e9c2b75c7661 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:37:18 +0200 Subject: feat(ls): add init --- fnl/config/lsp/init.fnl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 fnl/config/lsp/init.fnl diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl new file mode 100644 index 0000000..56d4096 --- /dev/null +++ b/fnl/config/lsp/init.fnl @@ -0,0 +1,12 @@ +;; Loads the LSP module. +(module config.lsp.init + {autoload {util util}}) + +(let [(ok? _) util.load-plugin :lspconfig] + (when ok? + (do + (require :config.lsp.lsp-installer) + ((require :config.lsp.handlers).setup) + (require :config.lsp.null-ls)))) + + -- cgit v1.2.3-70-g09d2 From 9ae371fc6c94765862719a2c57554ab98794cecd Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:37:29 +0200 Subject: feat(lsp installer): add fnl config --- fnl/config/lsp/lsp-installer.fnl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 fnl/config/lsp/lsp-installer.fnl diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl new file mode 100644 index 0000000..a32ee9b --- /dev/null +++ b/fnl/config/lsp/lsp-installer.fnl @@ -0,0 +1,26 @@ +;; LSP installer. + +(module config.lsp.lsp-installer + {autoload {util util}}) + +(def- opts + {:on_attach: ((require :config.lsp.handlers).on_attach) + :capabilities ((require :config.lsp.handlers).capabilities)}) + +(defn- get-server-opts [server] + (when (= server.name :jsonls) + (let [jsonls-opts (require :config.lsp.settings.jsonls)] + (vim.tbl_deep_extend :force jsonls-opts opts))) + (when (= server.name :sumneko_lua) + (let [sumneko-lua-opts (require :config.lsp.settings.sumneko-lua)] + (vim.tbl_deep_extend :force sumneko-lua-opts opts))) + (when (= server.name :pyright) + (let [pyright-opts (require :config.lsp.settings.pyright)] + (vim.tbl_deep_extend :force pyright-opts opts)))) + + +(let [(ok? lsp-installer) util.load-plugin :lsp-installer] + (when ok? + (lsp-installer.on_server_ready (fn [server] + (let [opts (get-server-opts server)] + server:setup opts))))) -- cgit v1.2.3-70-g09d2 From ad2c268442300514ef18420f6b69f9053cb448cf Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:37:38 +0200 Subject: feat(null ls): add fnl config --- fnl/config/lsp/null-ls.fnl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 fnl/config/lsp/null-ls.fnl diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl new file mode 100644 index 0000000..b2bc1e2 --- /dev/null +++ b/fnl/config/lsp/null-ls.fnl @@ -0,0 +1,29 @@ +;; Adds LSP diagnostics and formatting. +(module config.lsp.null-ls + {autoload {util util}}) + +(let [(ok? null-ls) util.load-plugin :null-ls] + (when ok? + (let [formatting null_ls.builtins.formatting diagnostics null_ls.builtins.diagnostics]) + (null-ls.setup + {:debug false + :sources [ + (diagnostics.flake8) + (diagnostics.golangci_lint) + (diagnostics.jsonlint) + (diagnostics.shellcheck) + (diagnostics.yamllint) + (formatting.black.with { extra_args [ "--fast" ] }) + (formatting.erlfmt) + (formatting.fourmolu) + (formatting.gofmt) + (formatting.goimports) + (formatting.nixfmt) + (formatting.prettier.with { + extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] + }) + (formatting.rustfmt) + (formatting.shfmt) + (formatting.sqlformat) + (formatting.stylua) + (formatting.terraform_fmt)]}))) -- cgit v1.2.3-70-g09d2 From 65bf9057169e92de4227cf5e080b2d31c3b6e66c Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:38:02 +0200 Subject: fix(plugin init): load configs --- fnl/config/init.fnl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index 8f472f5..0f3052d 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -11,4 +11,13 @@ _ config.gitsigns _ config.lualine _ config.ncomment - _ config.nvim-tree}}) + _ config.nvim-tree + _ config.orgmode + _ config.project + _ config.spectre + _ config.telescope + _ config.treesitter + _ config.which-key + _ config.zen + _ config.lsp}}) + -- cgit v1.2.3-70-g09d2 From 9404b0daa8733fb830b98eb13503c7f1bcbb915b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 22:38:24 +0200 Subject: build: add schema store dep --- fnl/plugins.fnl | 1 + 1 file changed, 1 insertion(+) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 1772fbb..c649f5c 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -24,6 +24,7 @@ :williamboman/nvim-lsp-installer {} :tamago324/nlsp-settings.nvim {} :jose-elias-alvarez/null-ls.nvim {} + :b0o/SchemaStore.nvim {} ;; Snippets :L3MON4D3/LuaSnip {} -- cgit v1.2.3-70-g09d2 From e1c5a423a6e8abec507d89863903be869762a55e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 23:47:53 +0200 Subject: chore(lua): nuke lua files --- lua/bootstrap.lua | 50 -------- lua/config/alpha.lua | 44 ------- lua/config/autocommands.lua | 33 ----- lua/config/autopairs.lua | 34 ----- lua/config/bufferline.lua | 167 ------------------------ lua/config/cmp.lua | 133 -------------------- lua/config/colorizer.lua | 16 --- lua/config/colorscheme.lua | 9 -- lua/config/comment.lua | 24 ---- lua/config/gitsigns.lua | 75 ----------- lua/config/hop.lua | 8 -- lua/config/impatient.lua | 8 -- lua/config/init.lua | 23 ---- lua/config/lsp/handlers.lua | 170 ------------------------- lua/config/lsp/init.lua | 10 -- lua/config/lsp/lsp-installer.lua | 34 ----- lua/config/lsp/null-ls.lua | 38 ------ lua/config/lsp/settings/jsonls.lua | 178 -------------------------- lua/config/lsp/settings/pyright.lua | 12 -- lua/config/lsp/settings/sumneko_lua.lua | 18 --- lua/config/lualine.lua | 64 ---------- lua/config/nvim-tree.lua | 136 -------------------- lua/config/orgmode.lua | 20 --- lua/config/project.lua | 51 -------- lua/config/spectre.lua | 135 -------------------- lua/config/telescope.lua | 120 ------------------ lua/config/treesitter.lua | 29 ----- lua/config/whichkey.lua | 217 -------------------------------- lua/config/zen.lua | 28 ----- 29 files changed, 1884 deletions(-) delete mode 100644 lua/bootstrap.lua delete mode 100644 lua/config/alpha.lua delete mode 100644 lua/config/autocommands.lua delete mode 100644 lua/config/autopairs.lua delete mode 100644 lua/config/bufferline.lua delete mode 100644 lua/config/cmp.lua delete mode 100644 lua/config/colorizer.lua delete mode 100644 lua/config/colorscheme.lua delete mode 100644 lua/config/comment.lua delete mode 100644 lua/config/gitsigns.lua delete mode 100644 lua/config/hop.lua delete mode 100644 lua/config/impatient.lua delete mode 100644 lua/config/init.lua delete mode 100644 lua/config/lsp/handlers.lua delete mode 100644 lua/config/lsp/init.lua delete mode 100644 lua/config/lsp/lsp-installer.lua delete mode 100644 lua/config/lsp/null-ls.lua delete mode 100644 lua/config/lsp/settings/jsonls.lua delete mode 100644 lua/config/lsp/settings/pyright.lua delete mode 100644 lua/config/lsp/settings/sumneko_lua.lua delete mode 100644 lua/config/lualine.lua delete mode 100644 lua/config/nvim-tree.lua delete mode 100644 lua/config/orgmode.lua delete mode 100644 lua/config/project.lua delete mode 100644 lua/config/spectre.lua delete mode 100644 lua/config/telescope.lua delete mode 100644 lua/config/treesitter.lua delete mode 100644 lua/config/whichkey.lua delete mode 100644 lua/config/zen.lua diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua deleted file mode 100644 index 6e49324..0000000 --- a/lua/bootstrap.lua +++ /dev/null @@ -1,50 +0,0 @@ --- Bootstrap nvim with essential plugins. - -local fn = vim.fn -local fmt = string.format -local execute = vim.api.nvim_command - -local function ensure(user, repository) - local packer_path = fn.stdpath "data" .. "/site/pack" - local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) - if fn.empty(fn.glob(ensure_path)) > 0 then - execute(fmt("!git clone --depth 1 https://github.com/%s/%s %s", user, repository, ensure_path)) - execute(fmt("packadd %s", repository)) - end -end - --- Bootstrap install essential modules if not present -ensure("wbthomason", "packer.nvim") -ensure("Olical", "aniseed") -ensure("lewis6991", "impatient.nvim") - -local status_ok, packer = pcall(require, "packer") -if not status_ok then - return -end - --- Have packer use a popup window -packer.init { - display = { - open_fn = function() - return require("packer.util").float { border = "rounded" } - end, - }, -} - --- Autocommand that reloads neovim whenever plugins.fnl file is saved -vim.cmd [[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.fnl source | PackerCompile - augroup end -]] - --- Enable faster loading with impatient -require "impatient" - --- Load fennel config -vim.g["aniseed#env"] = { - module = "init", - compile = true -} diff --git a/lua/config/alpha.lua b/lua/config/alpha.lua deleted file mode 100644 index fa12693..0000000 --- a/lua/config/alpha.lua +++ /dev/null @@ -1,44 +0,0 @@ --- A customizable greeter. - -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - -local dashboard = require "alpha.themes.dashboard" -dashboard.section.header.val = { - [[ ##############..... ############## ]], - [[ ##############......############## ]], - [[ ##########..........########## ]], - [[ ##########........########## ]], - [[ ##########.......########## ]], - [[ ##########.....##########.. ]], - [[ ##########....##########..... ]], - [[ ..##########..##########......... ]], - [[ ....##########.#########............. ]], - [[ ..################JJJ............ ]], - [[ ################............. ]], - [[ ##############.JJJ.JJJJJJJJJJ ]], - [[ ############...JJ...JJ..JJ JJ ]], - [[ ##########....JJ...JJ..JJ JJ ]], - [[ ########......JJJ..JJJ JJJ JJJ ]], - [[ ###### ......... ]], - [[ ..... ]], - [[ . ]], -} -dashboard.section.buttons.val = { - dashboard.button("f", " Find file", ":Telescope file_browser "), - dashboard.button("e", " New file", ":ene startinsert "), - dashboard.button("p", " Find project", ":Telescope projects "), - dashboard.button("r", " Recently used files", ":Telescope oldfiles "), - dashboard.button("t", " Find text", ":Telescope live_grep "), - dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " Quit Neovim", ":qa"), -} - -dashboard.section.header.opts.hl = "AlphaHeader" -dashboard.section.buttons.opts.hl = "AlphaButtons" - -dashboard.opts.opts.noautocmd = true --- vim.cmd([[autocmd User AlphaReady echo 'ready']]) -alpha.setup(dashboard.opts) diff --git a/lua/config/autocommands.lua b/lua/config/autocommands.lua deleted file mode 100644 index ef144d9..0000000 --- a/lua/config/autocommands.lua +++ /dev/null @@ -1,33 +0,0 @@ --- autocmd! remove all autocommands, if entered under a group it will clear that group - -vim.cmd [[ - augroup _general_settings - autocmd! - autocmd FileType qf,help,man,lspinfo nnoremap q :close - autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}) - autocmd BufWinEnter * :set formatoptions-=cro - autocmd FileType qf set nobuflisted - augroup end - - augroup _git - autocmd! - autocmd FileType gitcommit setlocal wrap - autocmd FileType gitcommit setlocal spell - augroup end - - augroup _markdown - autocmd! - autocmd FileType markdown setlocal wrap - autocmd FileType markdown setlocal spell - augroup end - - augroup _auto_resize - autocmd! - autocmd VimResized * tabdo wincmd = - augroup end - - augroup _alpha - autocmd! - autocmd User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2 - augroup end -]] diff --git a/lua/config/autopairs.lua b/lua/config/autopairs.lua deleted file mode 100644 index e218aff..0000000 --- a/lua/config/autopairs.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Autopair for brackets and quote symbols. - -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -} - -local cmp_autopairs = require "nvim-autopairs.completion.cmp" -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) diff --git a/lua/config/bufferline.lua b/lua/config/bufferline.lua deleted file mode 100644 index 04a2e79..0000000 --- a/lua/config/bufferline.lua +++ /dev/null @@ -1,167 +0,0 @@ --- Adds a bar that displays open buffers. - -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup { - options = { - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = nil, -- can be a string | function, see "Mouse actions" - left_mouse_command = nil, -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator_icon = "", - buffer_close_icon = "", - modified_icon = "●", - close_icon = "", - left_trunc_marker = "", - right_trunc_marker = "", - --- name_formatter can be used to change the buffer's label in the bufferline. - --- Please note some names can/will break the - --- bufferline so use this at your discretion knowing that it has - --- some limitations that will *NOT* be fixed. - -- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" - -- -- remove extension from markdown files for example - -- if buf.name:match('%.md') then - -- return vim.fn.fnamemodify(buf.name, ':t:r') - -- end - -- end, - max_name_length = 30, - max_prefix_length = 30, -- prefix used when a buffer is de-duplicated - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - -- diagnostics_indicator = function(count, level, diagnostics_dict, context) - -- return "("..count..")" - -- end, - -- NOTE: this will be called a lot so don't do any heavy processing here - -- custom_filter = function(buf_number) - -- -- filter out filetypes you don't want to see - -- if vim.bo[buf_number].filetype ~= "" then - -- return true - -- end - -- -- filter out by buffer name - -- if vim.fn.bufname(buf_number) ~= "" then - -- return true - -- end - -- -- filter out based on arbitrary rules - -- -- e.g. filter out vim wiki buffer from tabline in your work repo - -- if vim.fn.getcwd() == "" and vim.bo[buf_number].filetype ~= "wiki" then - -- return true - -- end - -- end, - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - show_buffer_icons = false, - show_buffer_close_icons = false, - show_close_icon = false, - show_tab_indicators = false, - persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - -- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b) - -- -- add custom logic - -- return buffer_a.modified > buffer_b.modified - -- end - }, - highlights = { - fill = { - guifg = { attribute = "fg", highlight = "#ff0000" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - background = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - - -- buffer_selected = { - -- guifg = {attribute='fg',highlight='#ff0000'}, - -- guibg = {attribute='bg',highlight='#0000ff'}, - -- gui = 'none' - -- }, - buffer_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - - close_button = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - -- close_button_selected = { - -- guifg = {attribute='fg',highlight='TabLineSel'}, - -- guibg ={attribute='bg',highlight='TabLineSel'} - -- }, - - tab_selected = { - guifg = { attribute = "fg", highlight = "Normal" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - guifg = { attribute = "fg", highlight = "TabLineSel" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - - duplicate_selected = { - guifg = { attribute = "fg", highlight = "TabLineSel" }, - guibg = { attribute = "bg", highlight = "TabLineSel" }, - gui = "italic", - }, - duplicate_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - gui = "italic", - }, - duplicate = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - gui = "italic", - }, - - modified = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - guifg = { attribute = "fg", highlight = "Normal" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - guifg = { attribute = "bg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - guifg = { attribute = "bg", highlight = "Normal" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - -- separator_visible = { - -- guifg = {attribute='bg',highlight='TabLine'}, - -- guibg = {attribute='bg',highlight='TabLine'} - -- }, - indicator_selected = { - guifg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - }, -} diff --git a/lua/config/cmp.lua b/lua/config/cmp.lua deleted file mode 100644 index 6f136b2..0000000 --- a/lua/config/cmp.lua +++ /dev/null @@ -1,133 +0,0 @@ --- Configuration for completion plugin. - -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -require("luasnip/loaders/from_vscode").lazy_load() - -local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" -end - -local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", -} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - vim_item.menu = ({ - nvim_lsp = "[LSP]", - nvim_lua = "[NVIM_LUA]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - -- TODO: check out more sources - sources = { - { name = "nvim_lsp" }, - { name = "nvim_lua" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - { name = "orgmode" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - experimental = { - ghost_text = false, - native_menu = false, - }, -} diff --git a/lua/config/colorizer.lua b/lua/config/colorizer.lua deleted file mode 100644 index a964c94..0000000 --- a/lua/config/colorizer.lua +++ /dev/null @@ -1,16 +0,0 @@ --- Enables colorization of color codes in source files. - -local status_ok, colorizer = pcall(require, "colorizer") -if not status_ok then - return -end - -colorizer.setup({ "*" }, { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - RRGGBBAA = true, -- #RRGGBBAA hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn -}) diff --git a/lua/config/colorscheme.lua b/lua/config/colorscheme.lua deleted file mode 100644 index 8fe7c27..0000000 --- a/lua/config/colorscheme.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Neovim colorscheme. - -local colorscheme = "no-clown-fiesta" - -local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) -if not status_ok then - vim.notify("colorscheme " .. colorscheme .. " not found!") - return -end diff --git a/lua/config/comment.lua b/lua/config/comment.lua deleted file mode 100644 index 4968314..0000000 --- a/lua/config/comment.lua +++ /dev/null @@ -1,24 +0,0 @@ --- Language aware commenting. - -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup { - pre_hook = function(ctx) - local U = require "Comment.utils" - - local location = nil - if ctx.ctype == U.ctype.block then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring { - key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - location = location, - } - end, -} diff --git a/lua/config/gitsigns.lua b/lua/config/gitsigns.lua deleted file mode 100644 index 3a5ce9d..0000000 --- a/lua/config/gitsigns.lua +++ /dev/null @@ -1,75 +0,0 @@ --- Add git signs to source files. - -local status_ok, gitsigns = pcall(require, "gitsigns") -if not status_ok then - return -end - -gitsigns.setup { - signs = { - add = { - hl = "GitSignsAdd", - text = "▎", - numhl = "GitSignsAddNr", - linehl = "GitSignsAddLn", - }, - change = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - delete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - topdelete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - changedelete = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { - enable = false, - }, -} diff --git a/lua/config/hop.lua b/lua/config/hop.lua deleted file mode 100644 index 65fd792..0000000 --- a/lua/config/hop.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, hop = pcall(require, "hop") -if not status_ok then - return -end - -hop.setup() -vim.api.nvim_set_keymap("n", "s", ":HopChar2", { silent = true }) -vim.api.nvim_set_keymap("n", "S", ":HopWord", { silent = true }) diff --git a/lua/config/impatient.lua b/lua/config/impatient.lua deleted file mode 100644 index 2595ca1..0000000 --- a/lua/config/impatient.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Speeds up loading of lua modules. - -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/lua/config/init.lua b/lua/config/init.lua deleted file mode 100644 index 0052f77..0000000 --- a/lua/config/init.lua +++ /dev/null @@ -1,23 +0,0 @@ --- Loads all plugin configs. - -require "config.impatient" -require "config.colorscheme" -require "config.cmp" -require "config.lsp" -require "config.telescope" -require "config.treesitter" -require "config.autopairs" -require "config.comment" -require "config.gitsigns" -require "config.nvim-tree" -require "config.bufferline" -require "config.lualine" -require "config.project" -require "config.alpha" -require "config.whichkey" -require "config.autocommands" -require "config.hop" -require "config.zen" -require "config.spectre" -require "config.colorizer" -require "config.orgmode" diff --git a/lua/config/lsp/handlers.lua b/lua/config/lsp/handlers.lua deleted file mode 100644 index ba38faa..0000000 --- a/lua/config/lsp/handlers.lua +++ /dev/null @@ -1,170 +0,0 @@ --- Handler for LSP servers. - -local M = {} - --- TODO: backfill this to template -M.setup = function() - local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - } - - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) - end - - local config = { - -- disable virtual text - virtual_text = false, - -- show signs - signs = { - active = signs, - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - } - - vim.diagnostic.config(config) - - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "rounded", - }) - - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, - { - border = "rounded", - } - ) -end - -local function lsp_highlight_document(client) - -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then - vim.api.nvim_exec( - [[ - let ftToIgnore = ['html'] - augroup lsp_document_highlight - autocmd! * - autocmd CursorHold if index(ftToIgnore, &ft) < 0 | lua vim.lsp.buf.document_highlight() - autocmd CursorMoved if index(ftToIgnore, &ft) < 0 | lua vim.lsp.buf.clear_references() - augroup END - ]], - false - ) - end -end -local function lsp_keymaps(bufnr) - local opts = { noremap = true, silent = true } - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gD", - "lua vim.lsp.buf.declaration()", - opts - ) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gd", - "lua vim.lsp.buf.definition()", - opts - ) - vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gi", - "lua vim.lsp.buf.implementation()", - opts - ) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "rn", "lua vim.lsp.buf.rename()", opts) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gr", - "lua vim.lsp.buf.references()", - opts - ) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "ca", "lua vim.lsp.buf.code_action()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "f", "lua vim.diagnostic.open_float()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gl", - "lua vim.diagnostic.open_float()", - opts - ) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "q", - "lua vim.diagnostic.setloclist()", - opts - ) - vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]] -end - -M.on_attach = function(client, bufnr) - if client.name == "tsserver" then - client.resolved_capabilities.document_formatting = false - end - lsp_keymaps(bufnr) - lsp_highlight_document(client) -end - -local capabilities = vim.lsp.protocol.make_client_capabilities() - -local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -if not status_ok then - return -end - -M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) - -function M.enable_format_on_save() - vim.cmd [[ - augroup format_on_save - autocmd! - autocmd BufWritePre * lua vim.lsp.buf.formatting() - augroup end - ]] - vim.notify "Enabled format on save" -end - -function M.disable_format_on_save() - M.remove_augroup "format_on_save" - vim.notify "Disabled format on save" -end - -function M.toggle_format_on_save() - if vim.fn.exists "#format_on_save#BufWritePre" == 0 then - M.enable_format_on_save() - else - M.disable_format_on_save() - end -end - -function M.remove_augroup(name) - if vim.fn.exists("#" .. name) == 1 then - vim.cmd("au! " .. name) - end -end - -vim.cmd [[ command! LspToggleAutoFormat execute 'lua require("user.lsp.handlers").toggle_format_on_save()' ]] - -return M diff --git a/lua/config/lsp/init.lua b/lua/config/lsp/init.lua deleted file mode 100644 index a0bb068..0000000 --- a/lua/config/lsp/init.lua +++ /dev/null @@ -1,10 +0,0 @@ --- Loads the LSP module. - -local status_ok, _ = pcall(require, "lspconfig") -if not status_ok then - return -end - -require "config.lsp.lsp-installer" -require("config.lsp.handlers").setup() -require "config.lsp.null-ls" diff --git a/lua/config/lsp/lsp-installer.lua b/lua/config/lsp/lsp-installer.lua deleted file mode 100644 index 8bd6b98..0000000 --- a/lua/config/lsp/lsp-installer.lua +++ /dev/null @@ -1,34 +0,0 @@ --- LSP installer. - -local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") -if not status_ok then - return -end - --- Register a handler that will be called for all installed servers. --- Alternatively, you may also register handlers on specific server instances instead (see example below). -lsp_installer.on_server_ready(function(server) - local opts = { - on_attach = require("config.lsp.handlers").on_attach, - capabilities = require("config.lsp.handlers").capabilities, - } - - if server.name == "jsonls" then - local jsonls_opts = require "config.lsp.settings.jsonls" - opts = vim.tbl_deep_extend("force", jsonls_opts, opts) - end - - if server.name == "sumneko_lua" then - local sumneko_opts = require "config.lsp.settings.sumneko_lua" - opts = vim.tbl_deep_extend("force", sumneko_opts, opts) - end - - if server.name == "pyright" then - local pyright_opts = require "config.lsp.settings.pyright" - opts = vim.tbl_deep_extend("force", pyright_opts, opts) - end - - -- This setup() function is exactly the same as lspconfig's setup function. - -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md - server:setup(opts) -end) diff --git a/lua/config/lsp/null-ls.lua b/lua/config/lsp/null-ls.lua deleted file mode 100644 index 662d429..0000000 --- a/lua/config/lsp/null-ls.lua +++ /dev/null @@ -1,38 +0,0 @@ --- Adds LSP diagnostics and formatting. - -local null_ls_status_ok, null_ls = pcall(require, "null-ls") -if not null_ls_status_ok then - return -end - --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting -local formatting = null_ls.builtins.formatting - --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics -local diagnostics = null_ls.builtins.diagnostics - -null_ls.setup { - debug = false, - sources = { - diagnostics.cppcheck, - diagnostics.flake8, - diagnostics.golangci_lint, - diagnostics.jsonlint, - diagnostics.shellcheck, - diagnostics.yamllint, - formatting.black.with { extra_args = { "--fast" } }, - formatting.erlfmt, - formatting.fourmolu, - formatting.gofmt, - formatting.goimports, - formatting.nixfmt, - formatting.prettier.with { - extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" }, - }, - formatting.rustfmt, - formatting.shfmt, - formatting.sqlformat, - formatting.stylua, - formatting.terraform_fmt, - }, -} diff --git a/lua/config/lsp/settings/jsonls.lua b/lua/config/lsp/settings/jsonls.lua deleted file mode 100644 index b1ef3aa..0000000 --- a/lua/config/lsp/settings/jsonls.lua +++ /dev/null @@ -1,178 +0,0 @@ --- A Json language server config. --- Find more schemas here: https://www.schemastore.org/json/ - -local schemas = { - { - description = "TypeScript compiler configuration file", - fileMatch = { - "tsconfig.json", - "tsconfig.*.json", - }, - url = "https://json.schemastore.org/tsconfig.json", - }, - { - description = "Lerna config", - fileMatch = { "lerna.json" }, - url = "https://json.schemastore.org/lerna.json", - }, - { - description = "Babel configuration", - fileMatch = { - ".babelrc.json", - ".babelrc", - "babel.config.json", - }, - url = "https://json.schemastore.org/babelrc.json", - }, - { - description = "ESLint config", - fileMatch = { - ".eslintrc.json", - ".eslintrc", - }, - url = "https://json.schemastore.org/eslintrc.json", - }, - { - description = "Bucklescript config", - fileMatch = { "bsconfig.json" }, - url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json", - }, - { - description = "Prettier config", - fileMatch = { - ".prettierrc", - ".prettierrc.json", - "prettier.config.json", - }, - url = "https://json.schemastore.org/prettierrc", - }, - { - description = "Vercel Now config", - fileMatch = { "now.json" }, - url = "https://json.schemastore.org/now", - }, - { - description = "Stylelint config", - fileMatch = { - ".stylelintrc", - ".stylelintrc.json", - "stylelint.config.json", - }, - url = "https://json.schemastore.org/stylelintrc", - }, - { - description = "A JSON schema for the ASP.NET LaunchSettings.json files", - fileMatch = { "launchsettings.json" }, - url = "https://json.schemastore.org/launchsettings.json", - }, - { - description = "Schema for CMake Presets", - fileMatch = { - "CMakePresets.json", - "CMakeUserPresets.json", - }, - url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json", - }, - { - description = "Configuration file as an alternative for configuring your repository in the settings page.", - fileMatch = { - ".codeclimate.json", - }, - url = "https://json.schemastore.org/codeclimate.json", - }, - { - description = "LLVM compilation database", - fileMatch = { - "compile_commands.json", - }, - url = "https://json.schemastore.org/compile-commands.json", - }, - { - description = "Config file for Command Task Runner", - fileMatch = { - "commands.json", - }, - url = "https://json.schemastore.org/commands.json", - }, - { - description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.", - fileMatch = { - "*.cf.json", - "cloudformation.json", - }, - url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json", - }, - { - description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.", - fileMatch = { - "serverless.template", - "*.sam.json", - "sam.json", - }, - url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json", - }, - { - description = "Json schema for properties json file for a GitHub Workflow template", - fileMatch = { - ".github/workflow-templates/**.properties.json", - }, - url = "https://json.schemastore.org/github-workflow-template-properties.json", - }, - { - description = "golangci-lint configuration file", - fileMatch = { - ".golangci.toml", - ".golangci.json", - }, - url = "https://json.schemastore.org/golangci-lint.json", - }, - { - description = "JSON schema for the JSON Feed format", - fileMatch = { - "feed.json", - }, - url = "https://json.schemastore.org/feed.json", - versions = { - ["1"] = "https://json.schemastore.org/feed-1.json", - ["1.1"] = "https://json.schemastore.org/feed.json", - }, - }, - { - description = "Packer template JSON configuration", - fileMatch = { - "packer.json", - }, - url = "https://json.schemastore.org/packer.json", - }, - { - description = "NPM configuration file", - fileMatch = { - "package.json", - }, - url = "https://json.schemastore.org/package.json", - }, - { - description = "Resume json", - fileMatch = { "resume.json" }, - url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", - }, -} - -local opts = { - settings = { - json = { - schemas = schemas, - }, - }, - setup = { - commands = { - Format = { - function() - vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 }) - end, - }, - }, - }, -} - -return opts diff --git a/lua/config/lsp/settings/pyright.lua b/lua/config/lsp/settings/pyright.lua deleted file mode 100644 index 780495e..0000000 --- a/lua/config/lsp/settings/pyright.lua +++ /dev/null @@ -1,12 +0,0 @@ --- Config for pyright language server. - -return { - settings = { - - python = { - analysis = { - typeCheckingMode = "off", - }, - }, - }, -} diff --git a/lua/config/lsp/settings/sumneko_lua.lua b/lua/config/lsp/settings/sumneko_lua.lua deleted file mode 100644 index ebf039f..0000000 --- a/lua/config/lsp/settings/sumneko_lua.lua +++ /dev/null @@ -1,18 +0,0 @@ --- Config for a Lua language server. - -return { - settings = { - - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua"] = true, - [vim.fn.stdpath "config" .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/lua/config/lualine.lua b/lua/config/lualine.lua deleted file mode 100644 index 15ca449..0000000 --- a/lua/config/lualine.lua +++ /dev/null @@ -1,64 +0,0 @@ --- Statusbar - -local status_ok, lualine = pcall(require, "lualine") -if not status_ok then - return -end - -local hide_in_width = function() - return vim.fn.winwidth(0) > 80 -end - -local diagnostics = { - "diagnostics", - sources = { "nvim_diagnostic" }, - sections = { "error", "warn" }, - symbols = { error = " ", warn = " " }, - colored = false, - update_in_insert = false, - always_visible = true, -} - -local diff = { - "diff", - colored = false, - symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols - cond = hide_in_width, -} - -local branch = { - "b:gitsigns_head", - icon = " ", - cond = hide_in_width, -} - -local filetype = { "filetype", cond = hide_in_width, color = {} } - -lualine.setup { - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline" }, - always_divide_middle = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { branch, "filename" }, - lualine_c = { diff }, - lualine_x = { diagnostics, filetype }, - lualine_y = {}, - lualine_z = { "location", "progress", "encoding" }, - }, - inactive_sections = { - lualine_a = { "mode" }, - lualine_b = { "filename" }, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = { "location", "progress", "encoding" }, - }, - tabline = {}, - extensions = {}, -} diff --git a/lua/config/nvim-tree.lua b/lua/config/nvim-tree.lua deleted file mode 100644 index 386ec49..0000000 --- a/lua/config/nvim-tree.lua +++ /dev/null @@ -1,136 +0,0 @@ --- A file explorer. - -vim.g.nvim_tree_icons = { - default = "", - symlink = "", - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "U", - ignored = "◌", - }, - folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - }, -} - -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - -local tree_cb = nvim_tree_config.nvim_tree_callback - -nvim_tree.setup { - auto_reload_on_write = true, - disable_netrw = false, - hide_root_folder = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - ignore_buffer_on_setup = false, - open_on_setup = false, - open_on_tab = false, - sort_by = "name", - update_cwd = false, - view = { - width = 30, - height = 30, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - mappings = { - custom_only = false, - list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - }, - }, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = false, - update_cwd = false, - ignore_list = {}, - }, - ignore_ft_on_setup = { - "startify", - "dashboard", - "alpha", - }, - system_open = { - cmd = nil, - args = {}, - }, - diagnostics = { - enable = true, - show_on_dirs = false, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - custom = {}, - exclude = {}, - }, - git = { - enable = true, - ignore = true, - timeout = 400, - }, - actions = { - change_dir = { - enable = true, - global = false, - }, - open_file = { - quit_on_open = false, - resize_window = false, - window_picker = { - enable = true, - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - }, - trash = { - cmd = "trash", - require_confirm = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - git = false, - profile = false, - }, - }, -} diff --git a/lua/config/orgmode.lua b/lua/config/orgmode.lua deleted file mode 100644 index 9f26189..0000000 --- a/lua/config/orgmode.lua +++ /dev/null @@ -1,20 +0,0 @@ -local status_ok, orgmode = pcall(require, "orgmode") -if not status_ok then - return -end - --- Load custom tree-sitter grammar for org filetype -orgmode.setup_ts_grammar() - -orgmode.setup { - org_agenda_files = { "~/.local/share/org/**/*" }, - org_default_notes_file = "~/.local/share/org/refile.org", - org_agenda_templates = { - t = { description = "Task", template = "* TODO %?\n %u" }, - m = { - description = "Meeting", - template = "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:", - }, - n = { description = "Note", template = "* NOTE %? :NOTE:\n %u" }, - }, -} diff --git a/lua/config/project.lua b/lua/config/project.lua deleted file mode 100644 index 738475c..0000000 --- a/lua/config/project.lua +++ /dev/null @@ -1,51 +0,0 @@ --- Provides project management. - -local status_ok, project = pcall(require, "project_nvim") -if not status_ok then - return -end - -project.setup { - ---@usage set to false to disable project.nvim. - --- This is on by default since it's currently the expected behavior. - active = true, - - on_config_done = nil, - - ---@usage set to true to disable setting the current-woriking directory - --- Manual mode doesn't automatically change your root directory, so you have - --- the option to manually do so using `:ProjectRoot` command. - manual_mode = false, - - ---@usage Methods of detecting the root directory - --- Allowed values: **"lsp"** uses the native neovim lsp - --- **"pattern"** uses vim-rooter like glob pattern matching. Here - --- order matters: if one is not detected, the other is used as fallback. You - --- can also delete or rearangne the detection methods. - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project - detection_methods = { "pattern" }, - - ---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods - patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - - ---@ Show hidden files in telescope when searching for files in a project - show_hidden = false, - - ---@usage When set to false, you will get a message when project.nvim changes your directory. - -- When set to false, you will get a message when project.nvim changes your directory. - silent_chdir = true, - - ---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... } - ignore_lsp = {}, - - ---@type string - ---@usage path to store the project history for use in telescope - datapath = vim.fn.stdpath "data", -} - -local tele_status_ok, telescope = pcall(require, "telescope") -if not tele_status_ok then - return -end - -telescope.load_extension "projects" diff --git a/lua/config/spectre.lua b/lua/config/spectre.lua deleted file mode 100644 index 0ee0d34..0000000 --- a/lua/config/spectre.lua +++ /dev/null @@ -1,135 +0,0 @@ -local status_ok, spectre = pcall(require, "spectre") -if not status_ok then - return -end -spectre.setup { - - color_devicons = true, - highlight = { - ui = "String", - search = "DiffChange", - replace = "DiffDelete", - }, - mapping = { - ["toggle_line"] = { - map = "t", - cmd = "lua require('spectre').toggle_line()", - desc = "toggle current item", - }, - ["enter_file"] = { - map = "", - cmd = "lua require('spectre.actions').select_entry()", - desc = "goto current file", - }, - ["send_to_qf"] = { - map = "Q", - cmd = "lua require('spectre.actions').send_to_qf()", - desc = "send all item to quickfix", - }, - ["replace_cmd"] = { - map = "c", - cmd = "lua require('spectre.actions').replace_cmd()", - desc = "input replace vim command", - }, - ["show_option_menu"] = { - map = "o", - cmd = "lua require('spectre').show_options()", - desc = "show option", - }, - ["run_replace"] = { - map = "R", - cmd = "lua require('spectre.actions').run_replace()", - desc = "replace all", - }, - ["change_view_mode"] = { - map = "m", - cmd = "lua require('spectre').change_view()", - desc = "change result view mode", - }, - ["toggle_ignore_case"] = { - map = "I", - cmd = "lua require('spectre').change_options('ignore-case')", - desc = "toggle ignore case", - }, - ["toggle_ignore_hidden"] = { - map = "H", - cmd = "lua require('spectre').change_options('hidden')", - desc = "toggle search hidden", - }, - -- you can put your mapping here it only use normal mode - }, - find_engine = { - -- rg is map with finder_cmd - ["rg"] = { - cmd = "rg", - -- default args - args = { - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - }, - options = { - ["ignore-case"] = { - value = "--ignore-case", - icon = "[I]", - desc = "ignore case", - }, - ["hidden"] = { - value = "--hidden", - desc = "hidden file", - icon = "[H]", - }, - -- you can put any option you want here it can toggle with - -- show_option function - }, - }, - ["ag"] = { - cmd = "ag", - args = { - "--vimgrep", - "-s", - }, - options = { - ["ignore-case"] = { - value = "-i", - icon = "[I]", - desc = "ignore case", - }, - ["hidden"] = { - value = "--hidden", - desc = "hidden file", - icon = "[H]", - }, - }, - }, - }, - replace_engine = { - ["sed"] = { - cmd = "sed", - args = nil, - }, - options = { - ["ignore-case"] = { - value = "--ignore-case", - icon = "[I]", - desc = "ignore case", - }, - }, - }, - default = { - find = { - --pick one of item in find_engine - cmd = "rg", - options = { "ignore-case" }, - }, - replace = { - --pick one of item in replace_engine - cmd = "sed", - }, - }, - replace_vim_cmd = "cdo", - is_open_target_win = true, --open file on opener window - is_insert_mode = false, -- start open panel on is_insert_mode -} diff --git a/lua/config/telescope.lua b/lua/config/telescope.lua deleted file mode 100644 index b7ef6e4..0000000 --- a/lua/config/telescope.lua +++ /dev/null @@ -1,120 +0,0 @@ --- Telescope a highly extendable fuzzy finder over lists. - -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -local actions = require "telescope.actions" - -telescope.setup { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - path_display = { "smart" }, - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - prompt_position = "top", - preview_cutoff = 120, - horizontal = { mirror = false }, - vertical = { mirror = false }, - }, - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - }, - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.close, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.complete_tag, - [""] = actions.which_key, -- keys from pressing - }, - n = { - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - ["H"] = actions.move_to_top, - ["M"] = actions.move_to_middle, - ["L"] = actions.move_to_bottom, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - - ["?"] = actions.which_key, - }, - }, - }, - pickers = { - -- Default configuration for builtin pickers goes here: - -- picker_name = { - -- picker_config_key = value, - -- ... - -- } - -- Now the picker_config_key will be applied every time you call this - -- builtin picker - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - }, - }, -} - -telescope.load_extension "fzf" -telescope.load_extension "file_browser" diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua deleted file mode 100644 index ec914fe..0000000 --- a/lua/config/treesitter.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Treesitter is a tool for building syntax trees for source files. --- In the neovim context it helps with better coloring. - -local status_ok, treesitter = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -treesitter.setup { - ensure_installed = "maintained", - sync_install = false, - ignore_install = { "" }, -- List of parsers to ignore installing - autopairs = { - enable = true, - }, - highlight = { - enable = true, -- false will disable the whole extension - disable = { "org" }, -- list of language that will be disabled - additional_vim_regex_highlighting = { "org" }, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - indent = { enable = true, disable = { "yaml", "python", "css" } }, - playground = { - enable = true, - }, -} diff --git a/lua/config/whichkey.lua b/lua/config/whichkey.lua deleted file mode 100644 index f68cdc9..0000000 --- a/lua/config/whichkey.lua +++ /dev/null @@ -1,217 +0,0 @@ -local status_ok, which_key = pcall(require, "which-key") -if not status_ok then - return -end - -local setup = { - plugins = { - marks = true, -- shows a list of your marks on ' and ` - registers = true, -- shows your registers on " in NORMAL or in INSERT mode - spelling = { - enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions - suggestions = 20, -- how many suggestions should be shown in the list? - }, - -- the presets plugin, adds help for a bunch of default keybindings in Neovim - -- No actual key bindings are created - presets = { - operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion - motions = false, -- adds help for motions - text_objects = false, -- help for text objects triggered after entering an operator - windows = true, -- default bindings on - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true, -- bindings for prefixed with g - }, - }, - -- add operators that will trigger motion and text object completion - -- to enable all native operators, set the preset / operators plugin above - -- operators = { gc = "Comments" }, - key_labels = { - -- override the label used to display some keys. It doesn't effect WK in any other way. - -- For example: - -- [""] = "SPC", - -- [""] = "RET", - -- [""] = "TAB", - }, - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "", -- symbol used between a key and it's label - group = "+", -- symbol prepended to a group - }, - popup_mappings = { - scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup - }, - window = { - border = "rounded", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] - padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] - winblend = 0, - }, - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 3, -- spacing between columns - align = "left", -- align columns left, center or right - }, - ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate - show_help = true, -- show help message on the command line when the popup is visible - triggers = "auto", -- automatically setup triggers - -- triggers = {""} -- or specify a list manually - triggers_blacklist = { - -- list of mode / prefixes that should never be hooked by WhichKey - -- this is mostly relevant for key maps that start with a native binding - -- most people should not need to change this - i = { "j", "k" }, - v = { "j", "k" }, - }, -} - -local opts = { - mode = "n", -- NORMAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps -} - -local mappings = { - ["k"] = { 'lua require("Comment.api").toggle_current_linewise()', "Comment" }, - ["a"] = { "Alpha", "Alpha" }, - ["b"] = { - "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})", - "Buffers", - }, - ["e"] = { "NvimTreeToggle", "Explorer" }, - ["c"] = { "Bdelete!", "Close Buffer" }, - ["n"] = { "nohlsearch", "No Highlight" }, - ["f"] = { - "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})", - "Find files", - }, - ["F"] = { "Telescope file_browser", "Browse files" }, - ["t"] = { "Telescope live_grep theme=ivy", "Find Text" }, - ["P"] = { "Telescope projects", "Projects" }, - ["z"] = { "ZenMode", "Zen Mode" }, - ["v"] = { "vsplit", "Vertical Split" }, - ["h"] = { "split", "Horizontal Split" }, - - p = { - name = "Packer", - c = { "PackerCompile", "Compile" }, - i = { "PackerInstall", "Install" }, - s = { "PackerSync", "Sync" }, - S = { "PackerStatus", "Status" }, - u = { "PackerUpdate", "Update" }, - }, - - g = { - name = "Git", - g = { "lua _LAZYGIT_TOGGLE()", "Lazygit" }, - j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, - k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, - l = { "lua require 'gitsigns'.blame_line()", "Blame" }, - p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, - r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, - R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, - s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, - u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk", - }, - o = { "Telescope git_status", "Open changed file" }, - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope git_commits", "Checkout commit" }, - d = { - "Gitsigns diffthis HEAD", - "Diff", - }, - }, - - l = { - name = "LSP", - a = { "lua vim.lsp.buf.code_action()", "Code Action" }, - d = { - "Telescope lsp_document_diagnostics", - "Document Diagnostics", - }, - w = { - "Telescope lsp_workspace_diagnostics", - "Workspace Diagnostics", - }, - f = { "lua vim.lsp.buf.formatting()", "Format" }, - i = { "LspInfo", "Info" }, - I = { "LspInstallInfo", "Installer Info" }, - j = { - "lua vim.lsp.diagnostic.goto_next()", - "Next Diagnostic", - }, - k = { - "lua vim.lsp.diagnostic.goto_prev()", - "Prev Diagnostic", - }, - l = { "lua vim.lsp.codelens.run()", "CodeLens Action" }, - q = { "lua vim.lsp.diagnostic.set_loclist()", "Quickfix" }, - r = { "lua vim.lsp.buf.rename()", "Rename" }, - s = { "Telescope lsp_document_symbols", "Document Symbols" }, - S = { - "Telescope lsp_dynamic_workspace_symbols", - "Workspace Symbols", - }, - }, - - s = { - name = "Search", - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope colorscheme", "Colorscheme" }, - h = { "Telescope help_tags", "Find Help" }, - M = { "Telescope man_pages", "Man Pages" }, - r = { "Telescope oldfiles", "Open Recent File" }, - R = { "Telescope registers", "Registers" }, - k = { "Telescope keymaps", "Keymaps" }, - C = { "Telescope commands", "Commands" }, - }, - - o = { - name = "Orgmode", - a = {"lua require('orgmode').action('agenda.prompt')", "Open agenda prompt"}, - c = {"lua require('orgmode').action('capture.prompt')", "Open capture prompt"}, - }, - - r = { - name = "Replace", - r = { "lua require('spectre').open()", "Replace" }, - w = { - "lua require('spectre').open_visual({select_word=true})", - "Replace Word", - }, - f = { "lua require('spectre').open_file_search()", "Replace Buffer" }, - }, - - T = { - name = "Treesitter", - p = { "TSPlaygroundToggle", "Playground" }, - }, -} - -local vopts = { - mode = "v", -- VISUAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps -} -local vmappings = { - ["k"] = { - 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())', - "Comment", - }, -} - -which_key.setup(setup) -which_key.register(mappings, opts) -which_key.register(vmappings, vopts) diff --git a/lua/config/zen.lua b/lua/config/zen.lua deleted file mode 100644 index b54442d..0000000 --- a/lua/config/zen.lua +++ /dev/null @@ -1,28 +0,0 @@ --- Zen mode - -local status_ok, zen_mode = pcall(require, "zen-mode") -if not status_ok then - return -end - -zen_mode.setup { - window = { - backdrop = 1, - height = 1, -- height of the Zen window - width = 120, - 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 = { - gitsigns = { enabled = false }, -- disables git signs - tmux = { enabled = true }, - twilight = { enabled = true }, - }, -} -- cgit v1.2.3-70-g09d2 From 1bee94ff83340719d03ec1446b72c4e2475c796f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 23:48:16 +0200 Subject: fix(util): update error --- fnl/util.fnl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index eb706cc..29db949 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -5,5 +5,4 @@ (let [(ok? val-or-err) (pcall require name)] (if ok? (val-or-err) - (print "Could not load config: " val-or-err)))) - + (print (.. "Could not load config: " val-or-err))))) -- cgit v1.2.3-70-g09d2 From 31743e584d0dbd736ef739b466c8730b809c5fdc Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 23:49:34 +0200 Subject: fix(util): use vim notify for err msg --- fnl/util.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index 29db949..febecbd 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -5,4 +5,4 @@ (let [(ok? val-or-err) (pcall require name)] (if ok? (val-or-err) - (print (.. "Could not load config: " val-or-err))))) + (vim.notify (.. "Could not load config: " val-or-err) vim.log.levels.WARN)))) -- cgit v1.2.3-70-g09d2 From 5655b344260449c5a955d0f5c6e2dc52ab5004a8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 23:49:51 +0200 Subject: fix(lsp installer): remove newline --- fnl/config/lsp/lsp-installer.fnl | 1 - 1 file changed, 1 deletion(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index a32ee9b..b5ebb36 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -1,5 +1,4 @@ ;; LSP installer. - (module config.lsp.lsp-installer {autoload {util util}}) -- cgit v1.2.3-70-g09d2 From 72f533bdbf04ecd6f29b84d3025d6f55154a4260 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 23:50:11 +0200 Subject: feat(handlers): add config --- fnl/config/lsp/handlers.fnl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index e69de29..fc0b006 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -0,0 +1,35 @@ +(module config.lsp.handlers) + +(def- signs + [{ :name "DiagnosticSignError" :text "" } + { :name "DiagnosticSignWarn" :text "" } + { :name "DiagnosticSignHint" :text "" } + { :name "DiagnosticSignInfo" :text "" }]) + +(defn- apply-signs [] + (each [_ sign (ipairs signs)] + (vim.fn.sign_define sign.name { :texthl sign.name :text sign.text :numhl "" }))) + +(def- config + {:virtual_text false + :signs { + :active signs + } + :update_in_insert true + :underline true + :severity_sort true + :float { + :focusable false + :style "minimal" + :border "rounded" + :source "always" + :header "" + :prefix ""}}) + +(defn setup [] + (do + (apply-signs) + (vim.diagnostic.config config) + (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) + (set vim.lsp.handlers.textDocument/signatureHelp (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} )))) + -- cgit v1.2.3-70-g09d2 From 027761fa8ac08007d02a6a5ccedd72b12cc96aa1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 6 Apr 2022 23:58:04 +0200 Subject: fix(plugin): replace " with : --- fnl/plugins.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index c649f5c..0205f87 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -10,7 +10,7 @@ :nvim-lua/plenary.nvim {} ;; Useful lua functions used ny lots of plugins ;; Colorschemes - "aktersnurra/no-clown-fiesta.nvim" {} + :aktersnurra/no-clown-fiesta.nvim {} ;; LSP :hrsh7th/nvim-cmp {} ;; The completion plugin -- cgit v1.2.3-70-g09d2 From fa9a5c6b80b5b0ffdcddc4b1d1c6cfe887d0bb04 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:32:36 +0200 Subject: feat(lsp handler): finish fnl config --- fnl/config/lsp/handlers.fnl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index fc0b006..c691d1a 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -1,4 +1,6 @@ -(module config.lsp.handlers) +(module config.lsp.handlers + {autoload {util util + nvim aniseed.nvim}}) (def- signs [{ :name "DiagnosticSignError" :text "" } @@ -33,3 +35,25 @@ (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) (set vim.lsp.handlers.textDocument/signatureHelp (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} )))) +(defn- lsp-keymaps [bufnr] + (let [opts { :noremap true :silent true }] + (do + (nvim.buf_set_keymap bufnr :n :gD "lua vim.lsp.buf.declaration()" opts) + (nvim.buf_set_keymap bufnr :n :gd "lua vim.lsp.buf.definition()" opts) + (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" opts) + (nvim.buf_set_keymap bufnr :n :gI "lua vim.lsp.buf.implementation()" opts) + (nvim.buf_set_keymap bufnr :n :gr "lua vim.lsp.buf.references()" opts) + (nvim.buf_set_keymap bufnr :n :gl "lua vim.diagnostic.open_float()" opts) + (nvim.buf_set_keymap bufnr :n :q "lua vim.diagnostic.setloclist()" opts)))) + +(defn on-attach [client bufnr] + (if (= client.name :html) + (set client.resolved_capabilities.document_formatting false)) + (lsp-keymaps bufnr)) + +(defn capabilities [] + (let [capabilities (vim.lsp.protocol.make_client_capabilities)] + (set capabilities.textDocument.completion.completionItem.snippetSupport true) + (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] + (cmp-nvim-lsp.update_capabilities capabilities)) + (capabilities))) -- cgit v1.2.3-70-g09d2 From 71d538630b226da37e4ef21c5a84d6fad5f55421 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:32:53 +0200 Subject: fix(load plugin): correct loading err --- fnl/config/alpha.fnl | 35 ++++--- fnl/config/autocmd.fnl | 104 +++++++++++---------- fnl/config/autopairs.fnl | 43 +++++---- fnl/config/better-escape.fnl | 13 ++- fnl/config/bufferline.fnl | 5 +- fnl/config/cmp.fnl | 25 ++--- fnl/config/colorizer.fnl | 5 +- fnl/config/gitsigns.fnl | 71 +++++++------- fnl/config/hop.fnl | 9 +- fnl/config/impatient.fnl | 5 +- fnl/config/lsp/init.fnl | 13 +-- fnl/config/lsp/lsp-installer.fnl | 11 +-- fnl/config/lsp/null-ls.fnl | 50 +++++----- fnl/config/lsp/settings/jsonls.fnl | 25 +++-- fnl/config/lualine.fnl | 57 ++++++------ fnl/config/ncomment.fnl | 9 +- fnl/config/nvim-tree.fnl | 156 +++++++++++++++---------------- fnl/config/orgmode.fnl | 25 +++-- fnl/config/packer.fnl | 11 +-- fnl/config/project.fnl | 23 +++-- fnl/config/spectre.fnl | 183 ++++++++++++++++++------------------- fnl/config/telescope.fnl | 167 +++++++++++++++++---------------- fnl/config/treesitter.fnl | 31 +++---- fnl/config/which-key.fnl | 11 +-- fnl/config/zen.fnl | 29 +++--- 25 files changed, 545 insertions(+), 571 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index 651fec5..7febc6c 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -23,21 +23,20 @@ " . ", }) -(let [(ok? alpha) util.load-plugin :alpha] - (when ok? - (let [dashboard (require :alpha.themes.dashboard)] - (do - (dashboard.section.header.val ascii-art) - (dashboard.section.buttons.val { - (dashboard.button "f" " Find file" ":Telescope file_browser ") - (dashboard.button "e" " New file" ":ene startinsert ") - (dashboard.button "p" " Find project" ":Telescope projects ") - (dashboard.button "r" " Recently used files" ":Telescope oldfiles ") - (dashboard.button "t" " Find text" ":Telescope live_grep ") - (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") - (dashboard.button "q" " Quit Neovim" ":qa") - } - (dashboard.section.header.opts.hl :AlphaHeader) - (dashboard.section.buttons.opts.hl :AlphaButtons) - (dashboard.opts.opts.noautocmd true) - (alpha.setup {dashboard.opts})))))) +(let [alpha (util.load-plugin :alpha)] + (let [dashboard (require :alpha.themes.dashboard)] + (do + (set dashboard.section.header.val ascii-art) + (set dashboard.section.buttons.val { + (dashboard.button "f" " Find file" ":Telescope file_browser ") + (dashboard.button "e" " New file" ":ene startinsert ") + (dashboard.button "p" " Find project" ":Telescope projects ") + (dashboard.button "r" " Recently used files" ":Telescope oldfiles ") + (dashboard.button "t" " Find text" ":Telescope live_grep ") + (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") + (dashboard.button "q" " Quit Neovim" ":qa") + } + (set dashboard.section.header.opts.hl :AlphaHeader) + (set dashboard.section.buttons.opts.hl :AlphaButtons) + (set dashboard.opts.opts.noautocmd true) + (alpha.setup {dashboard.opts}))))) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index b6a3fe4..77d20c4 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -4,62 +4,68 @@ nvim aniseed.nvim a aniseed.core}}) -(def- group (nvim.create_autogroup :K {:clear true})) +(util.autocmd + :FileType + {:pattern [ :qf :help :man :lspinfo ] + :command "nnoremap q :close" + :group :_general_settings}) -(defn- autocmd [name opts] - (nvim.create_autocmd name (a.merge! {:group group} opts)) +(util.autocmd + :TextYankPost + {:pattern [ :* ] + :command "silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}" + :group :_general_settings}) -(autocmd :FileType - {:pattern [ :qf :help :man :lspinfo ] - :command "nnoremap q :close" - :group :_general_settings}) +(util.autocmd + :BufWinEnter + {:pattern [ :* ] + :command ":set formatoptions-=cro" + :group :_general_settings}) -(autocmd :TextYankPost - {:pattern [ :* ] - :command "silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}" - :group :_general_settings}) +(util.autocmd + :FileType + {:pattern [ :qf ] + :command "set nobuflisted" + :group :_general_settings}) -(autocmd :BufWinEnter - {:pattern [ :* ] - :command ":set formatoptions-=cro" - :group :_general_settings}) +(util.autocmd + :FileType + {:pattern [ :gitcommit ] + :command "setlocal wrap" + :group :_git}) -(autocmd :FileType - {:pattern [ :qf ] - :command "set nobuflisted" - :group :_general_settings}) +(util.autocmd + :FileType + {:pattern [ :gitcommit ] + :command "setlocal spell" + :group :_git}) -(autocmd :FileType - {:pattern [ :gitcommit ] - :command "setlocal wrap" - :group :_git}) +(util.autocmd + :FileType + {:pattern [ :markdown ] + :command "setlocal wrap" + :group :_markdown}) -(autocmd :FileType - {:pattern [ :gitcommit ] - :command "setlocal spell" - :group :_git}) +(util.autocmd + :FileType + {:pattern [ :markdown ] + :command "setlocal spell" + :group :_markdown}) -(autocmd :FileType - {:pattern [ :markdown ] - :command "setlocal wrap" - :group :_markdown}) +(util.autocmd + :VimResized + {:pattern [ :* ] + :command "tabdo wincmd =" + :group :_auto_resize}) -(autocmd :FileType - {:pattern [ :markdown ] - :command "setlocal spell" - :group :_markdown}) +(util.autocmd + :User + {:pattern [ :AlphaReady ] + :command "set showtabline=0 | autocmd BufUnload set showtabline=2" + :group :_alpha}) -(autocmd :VimResized - {:pattern [ :* ] - :command "tabdo wincmd =" - :group :_auto_resize}) - -(autocmd :User - {:pattern [ :AlphaReady ] - :command "set showtabline=0 | autocmd BufUnload set showtabline=2" - :group :_alpha}) - -(autocmd :BufWritePost - {:pattern [ :plugins.fnl ] - :command "source | PackerSync" - :group :packer_user_config}) +(util.autocmd + :BufWritePost + {:pattern [ :plugins.fnl ] + :command "source | PackerSync" + :group :packer_user_config}) diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl index 289db34..8d7025c 100644 --- a/fnl/config/autopairs.fnl +++ b/fnl/config/autopairs.fnl @@ -2,25 +2,24 @@ (module config.autopairs {autoload {util util}}) -(let [(ok? npairs) util.load-plugin :nvim-autopairs] - (when ok? - (npairs.setup { - :check_ts true - :ts_config { - :lua [ :string :source ] - :javascript [ :string :template_string ] - :java false - } - :disable_filetype [ :TelescopePrompt :spectre_panel ] - :fast_warp { - :map "" - :chars [ "{" "[" "(" '"' "'" ] - :pattern string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", "") - :check_comma true - :highlight :PmenuSel - :highlight_grey :LineNr - :offset 0 - :end_key $ - :keys qwertyuiopzxcvbnmasdfghjkl - :highlight PmenuSel - :highlight_grey LineNr}})) +(let [npairs (util.load-plugin :nvim-autopairs)] + (npairs.setup { + :check_ts true + :ts_config { + :lua [ :string :source ] + :javascript [ :string :template_string ] + :java false + } + :disable_filetype [ :TelescopePrompt :spectre_panel ] + :fast_warp { + :map "" + :chars [ "{" "[" "(" '"' "'" ] + :pattern string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", "") + :check_comma true + :highlight :PmenuSel + :highlight_grey :LineNr + :offset 0 + :end_key $ + :keys qwertyuiopzxcvbnmasdfghjkl + :highlight PmenuSel + :highlight_grey LineNr}}) diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl index 83b4d07..5c993b7 100644 --- a/fnl/config/better-escape.fnl +++ b/fnl/config/better-escape.fnl @@ -3,10 +3,9 @@ {autoload {util util}}) -(let [(ok? better-escape) util.load-plugin :better-escape] - (when ok? - (better-escape.setup { - :mapping ["jk" "jj"] - :timeout vim.o.timeoutlen - :clear_empty_lines false - :keys ""}}))) +(let [better-escape (util.load-plugin :better-escape)] + (better-escape.setup { + :mapping ["jk" "jj"] + :timeout vim.o.timeoutlen + :clear_empty_lines false + :keys ""}})) diff --git a/fnl/config/bufferline.fnl b/fnl/config/bufferline.fnl index 0b89170..fac26a4 100644 --- a/fnl/config/bufferline.fnl +++ b/fnl/config/bufferline.fnl @@ -113,6 +113,5 @@ :guifg { :attribute "fg" :highlight "LspDiagnosticsDefaultHint" } :guibg default-bg-normal}}) -(let [(ok? bufferline) util.load-plugin :bufferline] - (when ok? - (bufferline.setup {:options options :highlights highlights}))) +(let [bufferline (util.load-plugin :bufferline)] + (bufferline.setup {:options options :highlights highlights})) diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index f7e9c7b..3c1ac1d 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -3,26 +3,17 @@ {autoload {nvim aniseed.nvim util util}}) -(local luasnip (let [(ok? luasnip) util.load-plugin :luasnip] - (when ok? - (do - (require :luasnip/loaders/from_vscode).lazy_load) - luasnip))) -(local lspkind (let [(ok? lspkind) util.load-plugin :lspkind] - (when ok? - lspkind))) - -(lspkind.init) - -(defn- snip [args] - (luasnip.lsp_expand args.body) - -(let [(ok? cmp) util.load-plugin :cmp] - (when ok? +(let [cmp (util.load-plugin :cmp) + lspkind (util.load-plugin :lspkind) + luasnip (util.load-plugin :luasnip)] + (do + ((require :luasnip/loaders/from_vscode).lazy_load) + (lspkind.init) (cmp.setup { :snippet { - :expand snip} + :expand (fn [args] + (luasnip.lsp_expand args.body))} :mapping { "" (cmp.mapping.select_prev_item) "" (cmp.mapping.select_next_item)} diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl index 2e01af3..7118388 100644 --- a/fnl/config/colorizer.fnl +++ b/fnl/config/colorizer.fnl @@ -2,6 +2,5 @@ (module config.colorizer {autoload {util util}}) -(let [(ok? colorizer) util.load-plugin :colorizer] - (when ok? - (colorizer.setup))) +(let [colorizer (util.load-plugin :colorizer)] + (colorizer.setup)) diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl index 7216ad4..621f2b1 100644 --- a/fnl/config/gitsigns.fnl +++ b/fnl/config/gitsigns.fnl @@ -33,39 +33,38 @@ numhl "GitSignsChangeNr" linehl "GitSignsChangeLn"}}) -(let [(ok? gitsigns) util.load-plugin :gitsigns] - (when ok? - (gitsigns.setup { - :signs signs - :signcolumn true - :numhl false - :linehl false - :word_diff false - :watch_gitdir { - :interval 1000 - :follow_files true - } - :attach_to_untracked true - :current_line_blame false - :current_line_blame_opts { - :virt_text true - :virt_text_pos "eol" - :delay 1000 - :ignore_whitespace false - } - :current_line_blame_formatter_opts { - :relative_time false - } - :sign_priority 6 - :update_debounce 100 - :status_formatter nil - :max_file_length 40000 - :preview_config { - :border "single" - :style "minimal" - :relative "cursor" - :row 0 - :col 1 - } - :yadm { - :enable false}}))) +(let [gitsigns (util.load-plugin :gitsigns)] + (gitsigns.setup { + :signs signs + :signcolumn true + :numhl false + :linehl false + :word_diff false + :watch_gitdir { + :interval 1000 + :follow_files true + } + :attach_to_untracked true + :current_line_blame false + :current_line_blame_opts { + :virt_text true + :virt_text_pos "eol" + :delay 1000 + :ignore_whitespace false + } + :current_line_blame_formatter_opts { + :relative_time false + } + :sign_priority 6 + :update_debounce 100 + :status_formatter nil + :max_file_length 40000 + :preview_config { + :border "single" + :style "minimal" + :relative "cursor" + :row 0 + :col 1 + } + :yadm { + :enable false}})) diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl index d12c650..9f767b6 100644 --- a/fnl/config/hop.fnl +++ b/fnl/config/hop.fnl @@ -3,9 +3,8 @@ {autoload {util util nvim aniseed.nvim}}) -(let [(ok? hop) util.load-plugin :hop] - (when ok? - (hop.setup {}))) +(set nvim.set_keymap "n" "s" ":HopChar2" { :silent true }) +(set nvim.set_keymap "n" "S" ":HopWord" { :silent true }) -(nvim.set_keymap "n" "s" ":HopChar2" { :silent true }) -(nvim.set_keymap "n" "S" ":HopWord" { :silent true }) +(let [hop (util.load-plugin :hop)] + (hop.setup {})) diff --git a/fnl/config/impatient.fnl b/fnl/config/impatient.fnl index 06521d7..fda96a4 100644 --- a/fnl/config/impatient.fnl +++ b/fnl/config/impatient.fnl @@ -2,6 +2,5 @@ (module config.impatient {autoload {util util}}) -(let [(ok? impatient) util.load-plugin :impatient] - (when ok? - (impatient.enable_profile))) +(let [impatient (util.load-plugin :impatient)] + (impatient.enable_profile)) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl index 56d4096..aa61f61 100644 --- a/fnl/config/lsp/init.fnl +++ b/fnl/config/lsp/init.fnl @@ -2,11 +2,8 @@ (module config.lsp.init {autoload {util util}}) -(let [(ok? _) util.load-plugin :lspconfig] - (when ok? - (do - (require :config.lsp.lsp-installer) - ((require :config.lsp.handlers).setup) - (require :config.lsp.null-ls)))) - - +(let [_ (util.load-plugin :lspconfig)] + (do + (require :config.lsp.lsp-installer) + ((require :config.lsp.handlers).setup) + (require :config.lsp.null-ls))) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index b5ebb36..7946fdf 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -3,7 +3,7 @@ {autoload {util util}}) (def- opts - {:on_attach: ((require :config.lsp.handlers).on_attach) + {:on_attach: (require :config.lsp.handlers).on_attach :capabilities ((require :config.lsp.handlers).capabilities)}) (defn- get-server-opts [server] @@ -18,8 +18,7 @@ (vim.tbl_deep_extend :force pyright-opts opts)))) -(let [(ok? lsp-installer) util.load-plugin :lsp-installer] - (when ok? - (lsp-installer.on_server_ready (fn [server] - (let [opts (get-server-opts server)] - server:setup opts))))) +(let [lsp-installer (util.load-plugin :lsp-installer)] + (lsp-installer.on_server_ready (fn [server] + (let [opts (get-server-opts server)] + server:setup opts))))) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index b2bc1e2..0f9e459 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -2,28 +2,28 @@ (module config.lsp.null-ls {autoload {util util}}) -(let [(ok? null-ls) util.load-plugin :null-ls] - (when ok? - (let [formatting null_ls.builtins.formatting diagnostics null_ls.builtins.diagnostics]) - (null-ls.setup - {:debug false - :sources [ - (diagnostics.flake8) - (diagnostics.golangci_lint) - (diagnostics.jsonlint) - (diagnostics.shellcheck) - (diagnostics.yamllint) - (formatting.black.with { extra_args [ "--fast" ] }) - (formatting.erlfmt) - (formatting.fourmolu) - (formatting.gofmt) - (formatting.goimports) - (formatting.nixfmt) - (formatting.prettier.with { - extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] - }) - (formatting.rustfmt) - (formatting.shfmt) - (formatting.sqlformat) - (formatting.stylua) - (formatting.terraform_fmt)]}))) +(let [null-ls (util.load-plugin :null-ls)] + (let [formatting null_ls.builtins.formatting + diagnostics null_ls.builtins.diagnostics]) + (null-ls.setup + {:debug false + :sources [ + (diagnostics.flake8) + (diagnostics.golangci_lint) + (diagnostics.jsonlint) + (diagnostics.shellcheck) + (diagnostics.yamllint) + (formatting.black.with { extra_args [ "--fast" ] }) + (formatting.erlfmt) + (formatting.fourmolu) + (formatting.gofmt) + (formatting.goimports) + (formatting.nixfmt) + (formatting.prettier.with { + extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] + }) + (formatting.rustfmt) + (formatting.shfmt) + (formatting.sqlformat) + (formatting.stylua) + (formatting.terraform_fmt)]})) diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl index 1475fd1..5f4b18b 100644 --- a/fnl/config/lsp/settings/jsonls.fnl +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -2,16 +2,15 @@ (module config.lsp.settings.jsonls {autoload {util util}}) -(let [(ok? schemastore) util.load-plugin :schemastore] - (when ok? - (schemastore.setup - {:init_options { - :providerFormatter false} - :settings { - :json { - :schemas (schemastore.json.schemas)}} - :setup { - :commands { - :Format { - (fn [] - (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}}))) +(let [schemastore (util.load-plugin :schemastore)] + (schemastore.setup + {:init_options { + :providerFormatter false} + :settings { + :json { + :schemas (schemastore.json.schemas)}} + :setup { + :commands { + :Format { + (fn [] + (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}}))) diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index 908b6d2..8f12049 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -30,32 +30,31 @@ :cond hide_in_width :color {}}) -(let [(ok? lualine) util.load-plugin :lualine] - (when ok? - (lualine.setup { - :options { - :icons_enabled true - :theme "auto" - :component_separators { :left "" :right "" } - :section_separators { :left "" :right "" } - :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ] - :always_divide_middle true - } - :sections { - :lualine_a [ "mode" ] - :lualine_b { 1 branch 2 "filename" } - :lualine_c { 1 diff } - :lualine_x { 1 diagnostics 2 filetype } - :lualine_y {} - :lualine_z [ "location" "progress" "encoding" ] - } - :inactive_sections { - :lualine_a [ "mode" ] - :lualine_b [ "filename" ] - :lualine_c {} - :lualine_x {} - :lualine_y {} - :lualine_z [ "location" "progress" "encoding" ] - } - :tabline {} - :extensions {}}))) +(let [lualine (util.load-plugin :lualine)] + (lualine.setup { + :options { + :icons_enabled true + :theme "auto" + :component_separators { :left "" :right "" } + :section_separators { :left "" :right "" } + :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ] + :always_divide_middle true + } + :sections { + :lualine_a [ "mode" ] + :lualine_b { 1 branch 2 "filename" } + :lualine_c { 1 diff } + :lualine_x { 1 diagnostics 2 filetype } + :lualine_y {} + :lualine_z [ "location" "progress" "encoding" ] + } + :inactive_sections { + :lualine_a [ "mode" ] + :lualine_b [ "filename" ] + :lualine_c {} + :lualine_x {} + :lualine_y {} + :lualine_z [ "location" "progress" "encoding" ] + } + :tabline {} + :extensions {}})) diff --git a/fnl/config/ncomment.fnl b/fnl/config/ncomment.fnl index 68d4c97..b71fd1e 100644 --- a/fnl/config/ncomment.fnl +++ b/fnl/config/ncomment.fnl @@ -19,8 +19,7 @@ :key (get-type ctx U) :location (get-location ctx U)}))) -(let [(ok? ncomment) util.load-plugin :Comment] - (when ok? - (ncomment.setup - {:pre_hook (fn [ctx] - (pre-hook ctx))}))) +(let [ncomment (util.load-plugin :Comment)] + (ncomment.setup + {:pre_hook (fn [ctx] + (pre-hook ctx))})) diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl index b2f3ca2..4b8d8bb 100644 --- a/fnl/config/nvim-tree.fnl +++ b/fnl/config/nvim-tree.fnl @@ -22,84 +22,84 @@ :empty_open "" :symlink ""}}) -(let [(ok? nvim-tree) util.load-plugin :nvim-tree (_ nvim-tree-config) util.load-plugin :nvim-tree.config] - (when ok? - (let [tree-cb nvim_tree_config.nvim_tree_callback]) - (nvim-tree.setup - {:auto_reload_on_write true - :disable_netrw false - :hide_root_folder false - :hijack_cursor false - :hijack_netrw true - :hijack_unnamed_buffer_when_opening false - :ignore_buffer_on_setup false - :open_on_setup false - :open_on_tab false - :sort_by "name" +(let [nvim-tree (util.load-plugin :nvim-tree) + nvim-tree-config (util.load-plugin :nvim-tree.config)] + (let [tree-cb nvim_tree_config.nvim_tree_callback]) + (nvim-tree.setup + {:auto_reload_on_write true + :disable_netrw false + :hide_root_folder false + :hijack_cursor false + :hijack_netrw true + :hijack_unnamed_buffer_when_opening false + :ignore_buffer_on_setup false + :open_on_setup false + :open_on_tab false + :sort_by "name" + :update_cwd true + :view { + :width 30 + :height 30 + :side "left" + :preserve_window_proportions false + :number false + :relativenumber false + :signcolumn "yes" + :mappings { + :custom_only false + :list { + { :key [ "l" "" "o" ] :cb (tree_cb "edit") } + { :key "h" :cb (tree_cb "close_node") } + { :key "v" :cb (tree_cb "vsplit") }}}} + :hijack_directories { + :enable true + :auto_open true} + :update_focused_file { + :enable true :update_cwd true - :view { - :width 30 - :height 30 - :side "left" - :preserve_window_proportions false - :number false - :relativenumber false - :signcolumn "yes" - :mappings { - :custom_only false - :list { - { :key [ "l" "" "o" ] :cb (tree_cb "edit") } - { :key "h" :cb (tree_cb "close_node") } - { :key "v" :cb (tree_cb "vsplit") }}}} - :hijack_directories { + :ignore_list {}} + :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ] + :system_open { + :cmd nil + :args {}} + :diagnostics { + :enable true + :show_on_dirs false + :icons { + :hint "" + :info "" + :warning "" + :error ""}} + :filters { + :dotfiles false + :custom {} + :exclude {}} + :git { + :enable true + :ignore true + :timeout 400} + :actions { + :change_dir { :enable true - :auto_open true} - :update_focused_file { - :enable true - :update_cwd true - :ignore_list {}} - :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ] - :system_open { - :cmd nil - :args {}} - :diagnostics { - :enable true - :show_on_dirs false - :icons { - :hint "" - :info "" - :warning "" - :error ""}} - :filters { - :dotfiles false - :custom {} - :exclude {}} - :git { - :enable true - :ignore true - :timeout 400} - :actions { - :change_dir { + :global false} + :open_file { + :quit_on_open false + :resize_window false + :window_picker { :enable true - :global false} - :open_file { - :quit_on_open false - :resize_window false - :window_picker { - :enable true - :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" - :exclude { - :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ] - :buftype [ "nofile" "terminal" "help" ]}}}} - :trash { - :cmd "trash" - :require_confirm true} - :log { - :enable false - :truncate false - :types { - :all false - :config false - :copy_paste false - :git false - :profile false}}}))) + :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" + :exclude { + :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ] + :buftype [ "nofile" "terminal" "help" ]}}}} + :trash { + :cmd "trash" + :require_confirm true} + :log { + :enable false + :truncate false + :types { + :all false + :config false + :copy_paste false + :git false + :profile false}}})) diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl index ceea169..1ac245a 100644 --- a/fnl/config/orgmode.fnl +++ b/fnl/config/orgmode.fnl @@ -2,16 +2,15 @@ (module config.orgmode {autoload {util util}}) -(let [(ok? orgmode) util.load-plugin :orgmode] - (when ok? - (do - (orgmode.setup_ts_grammar) - (orgmode.setup - {:org_agenda_files { "~/.local/share/org/**/*" } - :org_default_notes_file "~/.local/share/org/refile.org" - :org_agenda_templates { - :t { :description "Task" :template "* TODO %?\n %u" } - :m { - :description "Meeting" - :template "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:"} - :n { :description "Note" :template "* NOTE %? :NOTE:\n %u" }}})))) +(let [orgmode (util.load-plugin :orgmode)] + (do + (orgmode.setup_ts_grammar) + (orgmode.setup + {:org_agenda_files { "~/.local/share/org/**/*" } + :org_default_notes_file "~/.local/share/org/refile.org" + :org_agenda_templates { + :t { :description "Task" :template "* TODO %?\n %u" } + :m { + :description "Meeting" + :template "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:"} + :n { :description "Note" :template "* NOTE %? :NOTE:\n %u" }}}))) diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl index 0bd8aef..0c5611b 100644 --- a/fnl/config/packer.fnl +++ b/fnl/config/packer.fnl @@ -2,9 +2,8 @@ (module config.packer {autoload {util util}}) -(let [(ok? packer) util.load-plugin :packer] - (when ok? - (packer.init { - :display { - :open_fn (fn [] - ((require :packer.util).float {:border :rounded}))}}))) +(let [packer (util.load-plugin :packer)] + (packer.init { + :display { + :open_fn (fn [] + ((require :packer.util).float {:border :rounded}))}})) diff --git a/fnl/config/project.fnl b/fnl/config/project.fnl index 30843f8..e2e6371 100644 --- a/fnl/config/project.fnl +++ b/fnl/config/project.fnl @@ -2,15 +2,14 @@ (module config.project {autoload {util util}}) -(let [(ok? project) util.load-plugin :project_nvim] - (when ok? - (project.setup - {:active true - :on_config_done nil - :manual_mode false - :detection_methods [ :patterns ] - :patterns [ :git :_darcs :.hg :.bzr :.svn :Makefile :package.json ] - :show_hidden false - :silent_chdir true - :ignore_lsp {} - :datapath (vim.fn.stdpath :data)}) +(let [project (util.load-plugin :project_nvim)] + (project.setup + {:active true + :on_config_done nil + :manual_mode false + :detection_methods [ :patterns ] + :patterns [ :git :_darcs :.hg :.bzr :.svn :Makefile :package.json ] + :show_hidden false + :silent_chdir true + :ignore_lsp {} + :datapath (vim.fn.stdpath :data)})) diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl index a6df5d1..2716178 100644 --- a/fnl/config/spectre.fnl +++ b/fnl/config/spectre.fnl @@ -2,99 +2,98 @@ (module config.spectre {autoload {util util}}) -(let [(ok? spectre) util.load-plugin :spectre] - (when ok? - (spectre.setup - {:color_devicons true - :highlight { - :ui "String" - :search "DiffChange" - :replace "DiffDelete"} - :mapping { - :toggle_line { - :map "t" - :cmd "lua require('spectre').toggle_line()" - :desc "toggle current item"} - :enter_file { - :map "" - :cmd "lua require('spectre.actions').select_entry()" - :desc "goto current file"} - :send_to_qf { - :map "Q" - :cmd "lua require('spectre.actions').send_to_qf()" - :desc "send all item to quickfix"} - :replace_cmd { - :map "c" - :cmd "lua require('spectre.actions').replace_cmd()" - :desc "input replace vim command"} - :show_option_menu { - :map "o" - :cmd "lua require('spectre').show_options()" - :desc "show option"} - :run_replace { - :map "R" - :cmd "lua require('spectre.actions').run_replace()" - :desc "replace all"} - :change_view_mode { - :map "m" - :cmd "lua require('spectre').change_view()" - :desc "change result view mode"} - :toggle_ignore_case { - :map "I" - :cmd "lua require('spectre').change_options('ignore-case')" - :desc "toggle ignore case"} - :toggle_ignore_hidden { - :map "H" - :cmd "lua require('spectre').change_options('hidden')" - :desc "toggle search hidden"}} - :find_engine { - :rg { - :cmd "rg" - :args [ - "--color=never" - "--no-heading" - "--with-filename" - "--line-number" - "--column"] - :options { - :ignore-case { - :value "--ignore-case" - :icon "[I]" - :desc "ignore case"} - :hidden { - :value "--hidden" - :desc "hidden file" - :icon "[H]"}}} - :ag { - :cmd "ag" - :args [ - "--vimgrep" - "-s" - ] - :options { - :ignore-case { - :value "-i" - :icon "[I]" - :desc "ignore case"} - :hidden { - :value "--hidden" - :desc "hidden file" - :icon "[H]"}}}} - :replace_engine { - :sed { - :cmd "sed" - :args nil} +(let [spectre (util.load-plugin :spectre)] + (spectre.setup + {:color_devicons true + :highlight { + :ui "String" + :search "DiffChange" + :replace "DiffDelete"} + :mapping { + :toggle_line { + :map "t" + :cmd "lua require('spectre').toggle_line()" + :desc "toggle current item"} + :enter_file { + :map "" + :cmd "lua require('spectre.actions').select_entry()" + :desc "goto current file"} + :send_to_qf { + :map "Q" + :cmd "lua require('spectre.actions').send_to_qf()" + :desc "send all item to quickfix"} + :replace_cmd { + :map "c" + :cmd "lua require('spectre.actions').replace_cmd()" + :desc "input replace vim command"} + :show_option_menu { + :map "o" + :cmd "lua require('spectre').show_options()" + :desc "show option"} + :run_replace { + :map "R" + :cmd "lua require('spectre.actions').run_replace()" + :desc "replace all"} + :change_view_mode { + :map "m" + :cmd "lua require('spectre').change_view()" + :desc "change result view mode"} + :toggle_ignore_case { + :map "I" + :cmd "lua require('spectre').change_options('ignore-case')" + :desc "toggle ignore case"} + :toggle_ignore_hidden { + :map "H" + :cmd "lua require('spectre').change_options('hidden')" + :desc "toggle search hidden"}} + :find_engine { + :rg { + :cmd "rg" + :args [ + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column"] :options { :ignore-case { :value "--ignore-case" :icon "[I]" - :desc "ignore case"}}} - :default { - :find { - :cmd "rg" - :options { "ignore-case" }} - :replace { - :cmd "sed"}} - :replace_vim_cmd "cdo" - :is_open_target_win true - :is_insert_mode false}) + :desc "ignore case"} + :hidden { + :value "--hidden" + :desc "hidden file" + :icon "[H]"}}} + :ag { + :cmd "ag" + :args [ + "--vimgrep" + "-s" + ] + :options { + :ignore-case { + :value "-i" + :icon "[I]" + :desc "ignore case"} + :hidden { + :value "--hidden" + :desc "hidden file" + :icon "[H]"}}}} + :replace_engine { + :sed { + :cmd "sed" + :args nil} + :options { + :ignore-case { + :value "--ignore-case" + :icon "[I]" + :desc "ignore case"}}} + :default { + :find { + :cmd "rg" + :options { "ignore-case" }} + :replace { + :cmd "sed"}} + :replace_vim_cmd "cdo" + :is_open_target_win true + :is_insert_mode false})) diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl index 86986e7..d026052 100644 --- a/fnl/config/telescope.fnl +++ b/fnl/config/telescope.fnl @@ -2,100 +2,99 @@ (module config.telescope {autoload {util util}}) -(let [(ok? telescope) util.load-plugin :telescope] - (when ok? - (do - (let [actions (require :telescope.actions)] - (telescope.setup { - :defaults { - :prompt_prefix " " - :selection_caret " " - :path_display [ "smart" ] - :initial_mode "insert" - :selection_strategy "reset" - :sorting_strategy "ascending" - :layout_strategy "horizontal" - :layout_config { - :prompt_position "top" - :preview_cutoff 120 - :horizontal { mirror false } - :vertical { mirror false }} - :vimgrep_arguments [ - "rg" - "--color=never" - "--no-heading" - "--with-filename" - "--line-number" - "--column" - "--smart-case" - "--hidden" - ] - :mappings { - :i { - : actions.cycle_history_next - : actions.cycle_history_prev +(let [telescope (util.load-plugin :telescope)] + (do + (let [actions (require :telescope.actions)] + (telescope.setup { + :defaults { + :prompt_prefix " " + :selection_caret " " + :path_display [ "smart" ] + :initial_mode "insert" + :selection_strategy "reset" + :sorting_strategy "ascending" + :layout_strategy "horizontal" + :layout_config { + :prompt_position "top" + :preview_cutoff 120 + :horizontal { mirror false } + :vertical { mirror false }} + :vimgrep_arguments [ + "rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + "--hidden" + ] + :mappings { + :i { + : actions.cycle_history_next + : actions.cycle_history_prev - : actions.move_selection_next - : actions.move_selection_previous + : actions.move_selection_next + : actions.move_selection_previous - : actions.close + : actions.close - : actions.move_selection_next - : actions.move_selection_previous + : actions.move_selection_next + : actions.move_selection_previous - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab - : actions.preview_scrolling_up - : actions.preview_scrolling_down + : actions.preview_scrolling_up + : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down - : (+ actions.toggle_selection actions.move_selection_worse) - : (+ actions.toggle_selection actions.move_selection_better) - : (+ actions.send_to_qflist actions.open_qflist) - : (+ actions.send_selected_to_qflist actions.open_qflist) - : actions.complete_tag - : actions.which_key} - :n { - : actions.close - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab + : (+ actions.toggle_selection actions.move_selection_worse) + : (+ actions.toggle_selection actions.move_selection_better) + : (+ actions.send_to_qflist actions.open_qflist) + : (+ actions.send_selected_to_qflist actions.open_qflist) + : actions.complete_tag + : actions.which_key} + :n { + : actions.close + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab - : (+ actions.toggle_selection actions.move_selection_worse) - : (+ actions.toggle_selection actions.move_selection_better) - : (+ actions.send_to_qflist actions.open_qflist) - : (+ actions.send_selected_to_qflist actions.open_qflist) + : (+ actions.toggle_selection actions.move_selection_worse) + : (+ actions.toggle_selection actions.move_selection_better) + : (+ actions.send_to_qflist actions.open_qflist) + : (+ actions.send_selected_to_qflist actions.open_qflist) - :j actions.move_selection_next - :k actions.move_selection_previous - :H actions.move_to_top - :M actions.move_to_middle - :L actions.move_to_bottom + :j actions.move_selection_next + :k actions.move_selection_previous + :H actions.move_to_top + :M actions.move_to_middle + :L actions.move_to_bottom - : actions.move_selection_next - : actions.move_selection_previous - :gg actions.move_to_top - :G actions.move_to_bottom + : actions.move_selection_next + : actions.move_selection_previous + :gg actions.move_to_top + :G actions.move_to_bottom - : actions.preview_scrolling_up - : actions.preview_scrolling_down + : actions.preview_scrolling_up + : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down - :? actions.which_key}}} - :extensions { - :fzf { - :fuzzy true - :override_generic_sorter true - :override_file_sorter true - :case_mode "smart_case"}}}) - (telescope.load_extension :fzf) - (telescope.load_extension :file_browser) - (telescope.load_extension :project))))) + :? actions.which_key}}} + :extensions { + :fzf { + :fuzzy true + :override_generic_sorter true + :override_file_sorter true + :case_mode "smart_case"}}}) + (telescope.load_extension :fzf) + (telescope.load_extension :file_browser) + (telescope.load_extension :project)))) diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index cfbf00c..1fc0ec2 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -3,19 +3,18 @@ (module config.treesitter {autoload {util util}}) -(let [(ok? treesitter) util.load-plugin :nvim-treesitter.config] - (when ok? - (treesitter.setup - {:ensure_installed "maintained" - :sync_install false - :ignore_install { "" } - :autopairs { :enable true } - :highlight { - :enable true - :disable [ "org" ] - :additional_vim_regex_highlighting [ "org" ]}} - :context_commentstring { - :enable true - :enable_autocmd false} - :indent { :enable true :disable [ "yaml" "python" "css" ] } - :playground { :enable true }} +(let [treesitter (util.load-plugin :nvim-treesitter.config)] + (treesitter.setup + {:ensure_installed "maintained" + :sync_install false + :ignore_install { "" } + :autopairs { :enable true } + :highlight { + :enable true + :disable [ "org" ] + :additional_vim_regex_highlighting [ "org" ]}} + :context_commentstring { + :enable true + :enable_autocmd false} + :indent { :enable true :disable [ "yaml" "python" "css" ] } + :playground { :enable true }})) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index b9fc923..c98609d 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -169,9 +169,8 @@ 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())' "Comment" ]}) -(let [(ok? which-key) util.load-plugin :nvim-which-key.config] - (when ok? - (do - (which-key.setup setup) - (when.register mappings opts) - (when.register vmappings vopts)))) +(let [which-key (util.load-plugin :nvim-which-key.config)] + (do + (which-key.setup setup) + (when.register mappings opts) + (when.register vmappings vopts))) diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl index b1063bb..411b664 100644 --- a/fnl/config/zen.fnl +++ b/fnl/config/zen.fnl @@ -2,18 +2,17 @@ (module config.zen-mode {autoload {util util}}) -(let [(ok? zen-mode) util.load-plugin :zen-mode] - (when ok? - (zen-mode.setup - {:window { - :backdrop 1 - :height 1 - :width 120 - :options { - :signcolumn "no" - :number false - :relativenumber false}} - :plugins { - :gitsigns { :enabled false } - :tmux { :enabled true } - :twilight { :enabled true }}}))) +(let [zen-mode (util.load-plugin :zen-mode)] + (zen-mode.setup + {:window { + :backdrop 1 + :height 1 + :width 120 + :options { + :signcolumn "no" + :number false + :relativenumber false}} + :plugins { + :gitsigns { :enabled false } + :tmux { :enabled true } + :twilight { :enabled true }}})) -- cgit v1.2.3-70-g09d2 From f8539bc54ee7f3fae08528e494e62b3c123c7674 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:33:15 +0200 Subject: refactor(autocmd): move to util --- fnl/util.fnl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fnl/util.fnl b/fnl/util.fnl index febecbd..5cc0367 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -1,6 +1,9 @@ ;; Utility functions. (module util) +(defn autocmd [name opts] + (nvim.create_autocmd name opts)) + (defn load-plugin [name] (let [(ok? val-or-err) (pcall require name)] (if ok? -- cgit v1.2.3-70-g09d2 From 96897206acd965dfd3f4f4fe0dd135d081862475 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:33:28 +0200 Subject: fix(options): set shortmess --- fnl/settings/options.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 112dc2b..a7bfb44 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -47,5 +47,5 @@ (set vim.cmd "set whichwrap+=<,>,[,],h,l") (set vim.cmd [[set iskeyword+=-]]) (set vim.cmd [[set formatoptions-=cro]]) -(nvim.ex.set "shortmess+=c") +(set nvim.ex.set "shortmess+=c") (apply-opts) -- cgit v1.2.3-70-g09d2 From a3c5be89d922a7bd7c2992eda7bd1bef4d8ddf44 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:41:58 +0200 Subject: fix: remove init req --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 7defcbf..6dfde98 100644 --- a/init.lua +++ b/init.lua @@ -6,4 +6,4 @@ vim.g["aniseed#env"] = { compile = true, } -require "init" +-- require "init" -- cgit v1.2.3-70-g09d2 From 58d9dab7440be116f6b62653f6dc5620a2353e1b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:46:23 +0200 Subject: feat(config init): add packer --- fnl/config/init.fnl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index 0f3052d..fb80ebc 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -1,7 +1,8 @@ ;; Load all plugin configs. (module config.init {require - {_ config.alpha + {_ config.packer + _ config.alpha _ config.autopairs _ config.better-escape _ config.bufferline -- cgit v1.2.3-70-g09d2 From 143d0de99399e9d6b4779ebd91a1cbcee5df5dd5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:46:45 +0200 Subject: feat(bootstrap): convert script to lua --- fnl/bootstrap.fnl | 31 ------------------------------- init.lua | 5 +++-- lua/bootstrap.lua | 29 +++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 33 deletions(-) delete mode 100644 fnl/bootstrap.fnl create mode 100644 lua/bootstrap.lua diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl deleted file mode 100644 index 2665550..0000000 --- a/fnl/bootstrap.fnl +++ /dev/null @@ -1,31 +0,0 @@ -;; Bootstraping for fresh install -(module bootstrap - {autoload {util util}}) - -(defn- fmt [s ...] - (string.format s ...)) - -(def- packer-path - (.. (vim.fn.stdpath :data) :site/pack)) - -(def- git-clone-url "!git clone --depth 1 https://github.com/%s/%s %s") - -(defn- execute [cmd] - (vim.api.nvim_command cmd)) - -(defn- ensure-path [packer-path repository] - (fmt "%s/packer/start/%s" packer-path repository)) - -(defn- ensure [user repository] - (let [path (ensure-path packer-path repository)]) - (if (> (vim.fn.empty (vim.fn.glob path) 0)) - (do - (execute (fmt git-clone-url user repository path)) - (execute (fmt "packadd %s" repository))))) - -(ensure :wbthomason :packer.nvim) -(ensure :Olical :aniseed) -(ensure :lewis6991 :impatient.nvim) - -(require :config.packer) -(require :config.impatient) diff --git a/init.lua b/init.lua index 6dfde98..43946ea 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,10 @@ -- Loads plugins for Neovim. +-- Bootstap essential plugins +require "bootstrap" + -- Load fennel config vim.g["aniseed#env"] = { module = "init", compile = true, } - --- require "init" diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua new file mode 100644 index 0000000..ab84c17 --- /dev/null +++ b/lua/bootstrap.lua @@ -0,0 +1,29 @@ +-- Bootstrap nvim with essential plugins. + +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command + +local function ensure(user, repository) + local packer_path = fn.stdpath "data" .. "/site/pack" + local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute( + fmt( + "!git clone --depth 1 https://github.com/%s/%s %s", + user, + repository, + ensure_path + ) + ) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") + +-- Enable faster loading with impatient +require "impatient" -- cgit v1.2.3-70-g09d2 From 936272fc2a5ae07470816d1b63f79bfadb3ef979 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:23:59 +0200 Subject: fix: typo bugs --- fnl/config/alpha.fnl | 40 +++++++++++++++++++------------------- fnl/config/autocmd.fnl | 2 +- fnl/config/better-escape.fnl | 2 +- fnl/config/bufferline.fnl | 2 +- fnl/config/hop.fnl | 6 +++--- fnl/config/lsp/null-ls.fnl | 4 ++-- fnl/config/lsp/settings/jsonls.fnl | 2 +- fnl/config/ncomment.fnl | 2 +- fnl/config/nvim-tree.fnl | 4 ++-- fnl/config/orgmode.fnl | 2 +- fnl/config/spectre.fnl | 2 +- fnl/config/which-key.fnl | 2 +- fnl/plugins.fnl | 2 +- fnl/settings/keymaps.fnl | 2 +- fnl/settings/options.fnl | 2 +- 15 files changed, 38 insertions(+), 38 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index 7febc6c..636dd56 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -2,26 +2,26 @@ (module config.alpha {autoload {util util}}) -(def- ascii-art { - " ##############..... ############## ", - " ##############......############## ", - " ##########..........########## ", - " ##########........########## ", - " ##########.......########## ", - " ##########.....##########.. ", - " ##########....##########..... ", - " ..##########..##########......... ", - " ....##########.#########............. ", - " ..################JJJ............ ", - " ################............. ", - " ##############.JJJ.JJJJJJJJJJ ", - " ############...JJ...JJ..JJ JJ ", - " ##########....JJ...JJ..JJ JJ ", - " ########......JJJ..JJJ JJJ JJJ ", - " ###### ......... ", - " ..... ", - " . ", -}) +(def- ascii-art [ + " ##############..... ############## " + " ##############......############## " + " ##########..........########## " + " ##########........########## " + " ##########.......########## " + " ##########.....##########.. " + " ##########....##########..... " + " ..##########..##########......... " + " ....##########.#########............. " + " ..################JJJ............ " + " ################............. " + " ##############.JJJ.JJJJJJJJJJ " + " ############...JJ...JJ..JJ JJ " + " ##########....JJ...JJ..JJ JJ " + " ########......JJJ..JJJ JJJ JJJ " + " ###### ......... " + " ..... " + " . " +]) (let [alpha (util.load-plugin :alpha)] (let [dashboard (require :alpha.themes.dashboard)] diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index 77d20c4..e5bf556 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -13,7 +13,7 @@ (util.autocmd :TextYankPost {:pattern [ :* ] - :command "silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}" + :callback (lambda [] (vim.highlight.on_yank {:timeout 200}) :group :_general_settings}) (util.autocmd diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl index 5c993b7..e486927 100644 --- a/fnl/config/better-escape.fnl +++ b/fnl/config/better-escape.fnl @@ -8,4 +8,4 @@ :mapping ["jk" "jj"] :timeout vim.o.timeoutlen :clear_empty_lines false - :keys ""}})) + :keys ""})) diff --git a/fnl/config/bufferline.fnl b/fnl/config/bufferline.fnl index fac26a4..f4ec98b 100644 --- a/fnl/config/bufferline.fnl +++ b/fnl/config/bufferline.fnl @@ -19,7 +19,7 @@ :tab_size 21 :diagnostics false :diagnostics_update_in_insert false - :offsets { { :filetype "NvimTree" :text "" :padding 1 } } + :offsets [ { :filetype "NvimTree" :text "" :padding 1 } ] :show_buffer_icons false :show_buffer_close_icons false :show_close_icon false diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl index 9f767b6..53ba9e9 100644 --- a/fnl/config/hop.fnl +++ b/fnl/config/hop.fnl @@ -3,8 +3,8 @@ {autoload {util util nvim aniseed.nvim}}) -(set nvim.set_keymap "n" "s" ":HopChar2" { :silent true }) -(set nvim.set_keymap "n" "S" ":HopWord" { :silent true }) - (let [hop (util.load-plugin :hop)] (hop.setup {})) + +(nvim.set_keymap "n" "s" ":HopChar2" { :silent true }) +(nvim.set_keymap "n" "S" ":HopWord" { :silent true }) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index 0f9e459..4f737f7 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -3,8 +3,8 @@ {autoload {util util}}) (let [null-ls (util.load-plugin :null-ls)] - (let [formatting null_ls.builtins.formatting - diagnostics null_ls.builtins.diagnostics]) + (let [formatting (null_ls.builtins.formatting) + diagnostics (null_ls.builtins.diagnostics)]) (null-ls.setup {:debug false :sources [ diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl index 5f4b18b..93378dc 100644 --- a/fnl/config/lsp/settings/jsonls.fnl +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -13,4 +13,4 @@ :commands { :Format { (fn [] - (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}}))) + (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})) diff --git a/fnl/config/ncomment.fnl b/fnl/config/ncomment.fnl index b71fd1e..2c983df 100644 --- a/fnl/config/ncomment.fnl +++ b/fnl/config/ncomment.fnl @@ -11,7 +11,7 @@ ((require :ts_context_commentstring.utils).get_cursor_location) (or (= ctx.motion U.motion.v) (= ctx.motion U.cmotion.V)) ((require :ts_context_commentstring.utils).get_visual_start_location) - (nil))) + nil)) (defn- pre-hook [ctx] (let [U (require :Comment.utils)] diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl index 4b8d8bb..c6dd93a 100644 --- a/fnl/config/nvim-tree.fnl +++ b/fnl/config/nvim-tree.fnl @@ -47,10 +47,10 @@ :signcolumn "yes" :mappings { :custom_only false - :list { + :list [ { :key [ "l" "" "o" ] :cb (tree_cb "edit") } { :key "h" :cb (tree_cb "close_node") } - { :key "v" :cb (tree_cb "vsplit") }}}} + { :key "v" :cb (tree_cb "vsplit") }}}] :hijack_directories { :enable true :auto_open true} diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl index 1ac245a..d8af6d4 100644 --- a/fnl/config/orgmode.fnl +++ b/fnl/config/orgmode.fnl @@ -6,7 +6,7 @@ (do (orgmode.setup_ts_grammar) (orgmode.setup - {:org_agenda_files { "~/.local/share/org/**/*" } + {:org_agenda_files [ "~/.local/share/org/**/*" ] :org_default_notes_file "~/.local/share/org/refile.org" :org_agenda_templates { :t { :description "Task" :template "* TODO %?\n %u" } diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl index 2716178..3a05c0b 100644 --- a/fnl/config/spectre.fnl +++ b/fnl/config/spectre.fnl @@ -91,7 +91,7 @@ :default { :find { :cmd "rg" - :options { "ignore-case" }} + :options [ "ignore-case" ]} :replace { :cmd "sed"}} :replace_vim_cmd "cdo" diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index c98609d..39dcdcf 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -52,7 +52,7 @@ :nowait true}) (def- mappings { - :k [ 'lua require("Comment.api").toggle_current_linewise()' "Comment" ] + :k [ "lua require('Comment.api').toggle_current_linewise()" "Comment" ] :a [ "Alpha" "Alpha" ] :b [ "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer false})" diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 0205f87..5caf7e8 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -49,7 +49,7 @@ :akinsho/bufferline.nvim {} :moll/vim-bbye {} - :nvim-lualine/lualine.nvim { :requires "kyazdani42/nvim-web-devicons" :opt true }} + :nvim-lualine/lualine.nvim { :requires "kyazdani42/nvim-web-devicons" :opt true } :ahmedkhalf/project.nvim {} :goolord/alpha-nvim {} :antoinemadec/FixCursorHold.nvim {} ;; This is needed to fix lsp doc highlight diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 70f8896..ae4ff2b 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -52,4 +52,4 @@ ;; Move text up and down (map "v" "" ":m .+1==" opts) (map "v" "" ":m .-2==" opts) -(map "v" "p" '"_dP' opts) +(map "v" "p" "\"_dP" opts) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index a7bfb44..3c2e548 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -42,7 +42,7 @@ (defn- apply-opts [opts] (each [k v (pairs opts)] - (set vim.opt[k] v))) + (set vim.opt.k v))) (set vim.cmd "set whichwrap+=<,>,[,],h,l") (set vim.cmd [[set iskeyword+=-]]) -- cgit v1.2.3-70-g09d2 From c713e546deca1f48a0d89980ff01191a50e8fcd2 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:32:41 +0200 Subject: fix(typos): bugs by typos and wrong lists --- fnl/config/alpha.fnl | 2 +- fnl/config/autocmd.fnl | 2 +- fnl/config/lsp/handlers.fnl | 2 +- fnl/config/lsp/null-ls.fnl | 4 ++-- fnl/config/lsp/settings/jsonls.fnl | 2 +- fnl/config/nvim-tree.fnl | 2 +- fnl/config/treesitter.fnl | 2 +- fnl/config/which-key.fnl | 4 ++-- fnl/settings/keymaps.fnl | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index 636dd56..dca13de 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -35,7 +35,7 @@ (dashboard.button "t" " Find text" ":Telescope live_grep ") (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") (dashboard.button "q" " Quit Neovim" ":qa") - } + }) (set dashboard.section.header.opts.hl :AlphaHeader) (set dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index e5bf556..1f90f8e 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -13,7 +13,7 @@ (util.autocmd :TextYankPost {:pattern [ :* ] - :callback (lambda [] (vim.highlight.on_yank {:timeout 200}) + :callback (lambda [] (vim.highlight.on_yank {:timeout 200})) :group :_general_settings}) (util.autocmd diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index c691d1a..6c3566e 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -56,4 +56,4 @@ (set capabilities.textDocument.completion.completionItem.snippetSupport true) (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] (cmp-nvim-lsp.update_capabilities capabilities)) - (capabilities))) + capabilities)) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index 4f737f7..0f9e459 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -3,8 +3,8 @@ {autoload {util util}}) (let [null-ls (util.load-plugin :null-ls)] - (let [formatting (null_ls.builtins.formatting) - diagnostics (null_ls.builtins.diagnostics)]) + (let [formatting null_ls.builtins.formatting + diagnostics null_ls.builtins.diagnostics]) (null-ls.setup {:debug false :sources [ diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl index 93378dc..37c4597 100644 --- a/fnl/config/lsp/settings/jsonls.fnl +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -13,4 +13,4 @@ :commands { :Format { (fn [] - (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})) + (vim.lsp.buf.range_formatting [] [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})) diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl index c6dd93a..583704b 100644 --- a/fnl/config/nvim-tree.fnl +++ b/fnl/config/nvim-tree.fnl @@ -50,7 +50,7 @@ :list [ { :key [ "l" "" "o" ] :cb (tree_cb "edit") } { :key "h" :cb (tree_cb "close_node") } - { :key "v" :cb (tree_cb "vsplit") }}}] + { :key "v" :cb (tree_cb "vsplit") }]}} :hijack_directories { :enable true :auto_open true} diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index 1fc0ec2..18d8f22 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -7,7 +7,7 @@ (treesitter.setup {:ensure_installed "maintained" :sync_install false - :ignore_install { "" } + :ignore_install [ "" ] :autopairs { :enable true } :highlight { :enable true diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 39dcdcf..845cd27 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -172,5 +172,5 @@ (let [which-key (util.load-plugin :nvim-which-key.config)] (do (which-key.setup setup) - (when.register mappings opts) - (when.register vmappings vopts))) + (which-key.register mappings opts) + (which-key.register vmappings vopts))) diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index ae4ff2b..2409915 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -52,4 +52,4 @@ ;; Move text up and down (map "v" "" ":m .+1==" opts) (map "v" "" ":m .-2==" opts) -(map "v" "p" "\"_dP" opts) +;; (map "v" "p" "\"_dP" opts) -- cgit v1.2.3-70-g09d2 From f30f56c7297b0c27ea78d6f3bef1a049a56f553d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:39:06 +0200 Subject: fix(autopairs): escape " --- fnl/config/autopairs.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl index 8d7025c..994bbf1 100644 --- a/fnl/config/autopairs.fnl +++ b/fnl/config/autopairs.fnl @@ -13,8 +13,8 @@ :disable_filetype [ :TelescopePrompt :spectre_panel ] :fast_warp { :map "" - :chars [ "{" "[" "(" '"' "'" ] - :pattern string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", "") + :chars [ "{" "[" "(" "\"" "'" ] + :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") :check_comma true :highlight :PmenuSel :highlight_grey :LineNr -- cgit v1.2.3-70-g09d2 From f7dcd28c9a00f9c9366801cc9c20c2ac93fa2714 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:41:19 +0200 Subject: fix(alpha): remove extra parenthesis --- fnl/config/alpha.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index dca13de..392e22d 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -39,4 +39,4 @@ (set dashboard.section.header.opts.hl :AlphaHeader) (set dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) - (alpha.setup {dashboard.opts}))))) + (alpha.setup {dashboard.opts})))) -- cgit v1.2.3-70-g09d2 From 85d48f74479f82abeb445bb66e6d0440fabb8daa Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:43:08 +0200 Subject: fix(alpha): remove set --- fnl/config/alpha.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index 392e22d..686dc93 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -36,7 +36,7 @@ (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") (dashboard.button "q" " Quit Neovim" ":qa") }) - (set dashboard.section.header.opts.hl :AlphaHeader) - (set dashboard.section.buttons.opts.hl :AlphaButtons) + (dashboard.section.header.opts.hl :AlphaHeader) + (dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) (alpha.setup {dashboard.opts})))) -- cgit v1.2.3-70-g09d2 From 4c392204be26961e49d725db2f63d598c3c1fc20 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:45:09 +0200 Subject: fix(alpha): update table type --- fnl/config/alpha.fnl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index 686dc93..bb55784 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -27,7 +27,7 @@ (let [dashboard (require :alpha.themes.dashboard)] (do (set dashboard.section.header.val ascii-art) - (set dashboard.section.buttons.val { + (set dashboard.section.buttons.val [ (dashboard.button "f" " Find file" ":Telescope file_browser ") (dashboard.button "e" " New file" ":ene startinsert ") (dashboard.button "p" " Find project" ":Telescope projects ") @@ -35,8 +35,8 @@ (dashboard.button "t" " Find text" ":Telescope live_grep ") (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") (dashboard.button "q" " Quit Neovim" ":qa") - }) - (dashboard.section.header.opts.hl :AlphaHeader) - (dashboard.section.buttons.opts.hl :AlphaButtons) + ]) + (set dashboard.section.header.opts.hl :AlphaHeader) + (set dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) (alpha.setup {dashboard.opts})))) -- cgit v1.2.3-70-g09d2 From 733d8de80970f6e5e4b2347ff30871e326319661 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:46:21 +0200 Subject: fix(alpha): remove brackets around opts --- fnl/config/alpha.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index bb55784..13a02c6 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -39,4 +39,4 @@ (set dashboard.section.header.opts.hl :AlphaHeader) (set dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) - (alpha.setup {dashboard.opts})))) + (alpha.setup dashboard.opts)))) -- cgit v1.2.3-70-g09d2 From 3998bff4ba31ddbd272cf5e63242395968b02615 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:47:41 +0200 Subject: fix(autopairs): to strings --- fnl/config/autopairs.fnl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl index 994bbf1..47ead0a 100644 --- a/fnl/config/autopairs.fnl +++ b/fnl/config/autopairs.fnl @@ -19,7 +19,7 @@ :highlight :PmenuSel :highlight_grey :LineNr :offset 0 - :end_key $ - :keys qwertyuiopzxcvbnmasdfghjkl - :highlight PmenuSel - :highlight_grey LineNr}}) + :end_key :$ + :keys :qwertyuiopzxcvbnmasdfghjkl + :highlight :PmenuSel + :highlight_grey :LineNr}}) -- cgit v1.2.3-70-g09d2 From 937378ab0fdb81d83737063ee7a2fd8ebc991164 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:53:15 +0200 Subject: fix(autopairs): add parenthesis --- fnl/config/autopairs.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl index 47ead0a..b2d0475 100644 --- a/fnl/config/autopairs.fnl +++ b/fnl/config/autopairs.fnl @@ -22,4 +22,4 @@ :end_key :$ :keys :qwertyuiopzxcvbnmasdfghjkl :highlight :PmenuSel - :highlight_grey :LineNr}}) + :highlight_grey :LineNr}})) -- cgit v1.2.3-70-g09d2 From 384bde9e29f16f0b72e5609e162e9b8c9b9c9f49 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:54:50 +0200 Subject: fix(lsp installer): remove capabilites call --- fnl/config/lsp/lsp-installer.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index 7946fdf..08c54ce 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -4,7 +4,7 @@ (def- opts {:on_attach: (require :config.lsp.handlers).on_attach - :capabilities ((require :config.lsp.handlers).capabilities)}) + :capabilities (require :config.lsp.handlers).capabilities}) (defn- get-server-opts [server] (when (= server.name :jsonls) -- cgit v1.2.3-70-g09d2 From 9c1138ccbf26b1e2c234057274d0fb3767de651b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:55:59 +0200 Subject: fix(lsp installer): remove delimiter --- fnl/config/lsp/lsp-installer.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index 08c54ce..b9a7c6f 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -21,4 +21,4 @@ (let [lsp-installer (util.load-plugin :lsp-installer)] (lsp-installer.on_server_ready (fn [server] (let [opts (get-server-opts server)] - server:setup opts))))) + server:setup opts)))) -- cgit v1.2.3-70-g09d2 From 76ff550565d121dfba3aab122e922e66d650e47f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 23:57:55 +0200 Subject: fix(lsp installer): call setup --- fnl/config/lsp/lsp-installer.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index b9a7c6f..f77a4be 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -21,4 +21,4 @@ (let [lsp-installer (util.load-plugin :lsp-installer)] (lsp-installer.on_server_ready (fn [server] (let [opts (get-server-opts server)] - server:setup opts)))) + (server:setup opts))))) -- cgit v1.2.3-70-g09d2 From 5756648079a7d9753ab72427e0ff20a9178dd1e1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 8 Apr 2022 00:02:45 +0200 Subject: fix(lang): typos --- fnl/config/lsp/null-ls.fnl | 32 ++++++++++++++++---------------- fnl/config/lsp/settings/jsonls.fnl | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index 0f9e459..d1f1af1 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -4,26 +4,26 @@ (let [null-ls (util.load-plugin :null-ls)] (let [formatting null_ls.builtins.formatting - diagnostics null_ls.builtins.diagnostics]) + diagnostics null_ls.builtins.diagnostics] (null-ls.setup {:debug false :sources [ - (diagnostics.flake8) - (diagnostics.golangci_lint) - (diagnostics.jsonlint) - (diagnostics.shellcheck) - (diagnostics.yamllint) + diagnostics.flake8 + diagnostics.golangci_lint + diagnostics.jsonlint + diagnostics.shellcheck + diagnostics.yamllint (formatting.black.with { extra_args [ "--fast" ] }) - (formatting.erlfmt) - (formatting.fourmolu) - (formatting.gofmt) - (formatting.goimports) - (formatting.nixfmt) + formatting.erlfmt + formatting.fourmolu + formatting.gofmt + formatting.goimports + formatting.nixfmt (formatting.prettier.with { extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] }) - (formatting.rustfmt) - (formatting.shfmt) - (formatting.sqlformat) - (formatting.stylua) - (formatting.terraform_fmt)]})) + formatting.rustfmt + formatting.shfmt + formatting.sqlformat + formatting.stylua + formatting.terraform_fmt]}))) diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl index 37c4597..c1cb710 100644 --- a/fnl/config/lsp/settings/jsonls.fnl +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -11,6 +11,6 @@ :schemas (schemastore.json.schemas)}} :setup { :commands { - :Format { + :Format [ (fn [] - (vim.lsp.buf.range_formatting [] [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})) + (vim.lsp.buf.range_formatting [] [ 0 0 ] [ (vim.fn.line "$" 0) ]))]}}})) -- cgit v1.2.3-70-g09d2 From c7ec0420d710f2f6bacc92d2ceaf8a9fa886aaeb Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 8 Apr 2022 00:06:46 +0200 Subject: fix(typos): final fixes of typos hopefully --- fnl/config/nvim-tree.fnl | 152 +++++++++++++++++++++++----------------------- fnl/config/treesitter.fnl | 2 +- fnl/config/which-key.fnl | 2 +- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl index 583704b..9e0945f 100644 --- a/fnl/config/nvim-tree.fnl +++ b/fnl/config/nvim-tree.fnl @@ -24,82 +24,82 @@ (let [nvim-tree (util.load-plugin :nvim-tree) nvim-tree-config (util.load-plugin :nvim-tree.config)] - (let [tree-cb nvim_tree_config.nvim_tree_callback]) - (nvim-tree.setup - {:auto_reload_on_write true - :disable_netrw false - :hide_root_folder false - :hijack_cursor false - :hijack_netrw true - :hijack_unnamed_buffer_when_opening false - :ignore_buffer_on_setup false - :open_on_setup false - :open_on_tab false - :sort_by "name" - :update_cwd true - :view { - :width 30 - :height 30 - :side "left" - :preserve_window_proportions false - :number false - :relativenumber false - :signcolumn "yes" - :mappings { - :custom_only false - :list [ - { :key [ "l" "" "o" ] :cb (tree_cb "edit") } - { :key "h" :cb (tree_cb "close_node") } - { :key "v" :cb (tree_cb "vsplit") }]}} - :hijack_directories { - :enable true - :auto_open true} - :update_focused_file { - :enable true + (let [tree-cb nvim_tree_config.nvim_tree_callback] + (nvim-tree.setup + {:auto_reload_on_write true + :disable_netrw false + :hide_root_folder false + :hijack_cursor false + :hijack_netrw true + :hijack_unnamed_buffer_when_opening false + :ignore_buffer_on_setup false + :open_on_setup false + :open_on_tab false + :sort_by "name" :update_cwd true - :ignore_list {}} - :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ] - :system_open { - :cmd nil - :args {}} - :diagnostics { - :enable true - :show_on_dirs false - :icons { - :hint "" - :info "" - :warning "" - :error ""}} - :filters { - :dotfiles false - :custom {} - :exclude {}} - :git { - :enable true - :ignore true - :timeout 400} - :actions { - :change_dir { + :view { + :width 30 + :height 30 + :side "left" + :preserve_window_proportions false + :number false + :relativenumber false + :signcolumn "yes" + :mappings { + :custom_only false + :list [ + { :key [ "l" "" "o" ] :cb (tree_cb "edit") } + { :key "h" :cb (tree_cb "close_node") } + { :key "v" :cb (tree_cb "vsplit") }]}} + :hijack_directories { :enable true - :global false} - :open_file { - :quit_on_open false - :resize_window false - :window_picker { + :auto_open true} + :update_focused_file { + :enable true + :update_cwd true + :ignore_list {}} + :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ] + :system_open { + :cmd nil + :args {}} + :diagnostics { + :enable true + :show_on_dirs false + :icons { + :hint "" + :info "" + :warning "" + :error ""}} + :filters { + :dotfiles false + :custom {} + :exclude {}} + :git { + :enable true + :ignore true + :timeout 400} + :actions { + :change_dir { :enable true - :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" - :exclude { - :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ] - :buftype [ "nofile" "terminal" "help" ]}}}} - :trash { - :cmd "trash" - :require_confirm true} - :log { - :enable false - :truncate false - :types { - :all false - :config false - :copy_paste false - :git false - :profile false}}})) + :global false} + :open_file { + :quit_on_open false + :resize_window false + :window_picker { + :enable true + :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" + :exclude { + :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ] + :buftype [ "nofile" "terminal" "help" ]}}}} + :trash { + :cmd "trash" + :require_confirm true} + :log { + :enable false + :truncate false + :types { + :all false + :config false + :copy_paste false + :git false + :profile false}}}))) diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index 18d8f22..f88a8b9 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -17,4 +17,4 @@ :enable true :enable_autocmd false} :indent { :enable true :disable [ "yaml" "python" "css" ] } - :playground { :enable true }})) + :playground { :enable true })) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 845cd27..7c5cf71 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -166,7 +166,7 @@ (def- vmappings { :k [ - 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())' + "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())" "Comment" ]}) (let [which-key (util.load-plugin :nvim-which-key.config)] -- cgit v1.2.3-70-g09d2 From c9f4969c23d60edc0169cec582ddc83ec4809699 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 8 Apr 2022 00:08:27 +0200 Subject: fix(keymaps): missing delimiter --- fnl/settings/keymaps.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 2409915..1d431e5 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -4,7 +4,7 @@ (def- opts {:noremap true :silent true}) (defn- map [mode lhs rhs opt] - (nvim.set_keymap mode lhs rhs opt) + (nvim.set_keymap mode lhs rhs opt)) ;;Remap space as leader key (map "" "" "" opts) @@ -52,4 +52,4 @@ ;; Move text up and down (map "v" "" ":m .+1==" opts) (map "v" "" ":m .-2==" opts) -;; (map "v" "p" "\"_dP" opts) +(map "v" "p" "\"_dP" opts) -- cgit v1.2.3-70-g09d2 From 897d7bd4e14bd7381ac61b57ee001633fa51a741 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 8 Apr 2022 00:10:15 +0200 Subject: fix(gitsigns): string keys --- fnl/config/gitsigns.fnl | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl index 621f2b1..d179e3e 100644 --- a/fnl/config/gitsigns.fnl +++ b/fnl/config/gitsigns.fnl @@ -3,35 +3,35 @@ {autoload {util util}}) (def- signs { - add { - hl "GitSignsAdd" - text "▎" - numhl "GitSignsAddNr" - linehl "GitSignsAddLn" + :add { + :hl "GitSignsAdd" + :text "▎" + :numhl "GitSignsAddNr" + :linehl "GitSignsAddLn" } - change { - hl "GitSignsChange" - text "▎" - numhl "GitSignsChangeNr" - linehl "GitSignsChangeLn" + :change { + :hl "GitSignsChange" + :text "▎" + :numhl "GitSignsChangeNr" + :linehl "GitSignsChangeLn" } - delete { - hl "GitSignsDelete" - text "契" - numhl "GitSignsDeleteNr" - linehl "GitSignsDeleteLn" + :delete { + :hl "GitSignsDelete" + :text "契" + :numhl "GitSignsDeleteNr" + :linehl "GitSignsDeleteLn" } - topdelete { - hl "GitSignsDelete" - text "契" - numhl "GitSignsDeleteNr" - linehl "GitSignsDeleteLn" + :topdelete { + :hl "GitSignsDelete" + :text "契" + :numhl "GitSignsDeleteNr" + :linehl "GitSignsDeleteLn" } - changedelete { - hl "GitSignsChange" - text "▎" - numhl "GitSignsChangeNr" - linehl "GitSignsChangeLn"}}) + :changedelete { + :hl "GitSignsChange" + :text "▎" + :numhl "GitSignsChangeNr" + :linehl "GitSignsChangeLn"}}) (let [gitsigns (util.load-plugin :gitsigns)] (gitsigns.setup { -- cgit v1.2.3-70-g09d2 From 272a51a0c72c195044e93dc220be4500c03d32c2 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 8 Apr 2022 00:12:33 +0200 Subject: fix: options --- fnl/settings/options.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 3c2e548..e492784 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -42,7 +42,7 @@ (defn- apply-opts [opts] (each [k v (pairs opts)] - (set vim.opt.k v))) + (vim.opt[k] v))) (set vim.cmd "set whichwrap+=<,>,[,],h,l") (set vim.cmd [[set iskeyword+=-]]) -- cgit v1.2.3-70-g09d2 From d50cc4ba5c6c34bd33ae4eacfbb0d11f9262e935 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 8 Apr 2022 00:14:33 +0200 Subject: fix(options): tset --- fnl/settings/options.fnl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index e492784..f011eb9 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -40,9 +40,9 @@ } ) -(defn- apply-opts [opts] - (each [k v (pairs opts)] - (vim.opt[k] v))) +(defn- apply-opts [...] + (each [k v (pairs ...)] + (tset vim.opt k v))) (set vim.cmd "set whichwrap+=<,>,[,],h,l") (set vim.cmd [[set iskeyword+=-]]) -- cgit v1.2.3-70-g09d2 From 25e73c80d92535895088d8e541f794b0f048e0f1 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:23:50 +0200 Subject: fix(util): return table --- fnl/util.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index 5cc0367..4ee8f8e 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -7,5 +7,5 @@ (defn load-plugin [name] (let [(ok? val-or-err) (pcall require name)] (if ok? - (val-or-err) + val-or-err (vim.notify (.. "Could not load config: " val-or-err) vim.log.levels.WARN)))) -- cgit v1.2.3-70-g09d2 From 568c1581b47ec27b6aaa1e5f5b7fab4bee180ed0 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:30:33 +0200 Subject: fix(telescope): remove reults_scrolling_up --- fnl/config/telescope.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl index d026052..af99d2d 100644 --- a/fnl/config/telescope.fnl +++ b/fnl/config/telescope.fnl @@ -50,8 +50,8 @@ : actions.preview_scrolling_up : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down + ;; : actions.results_scrolling_up + ;; : actions.results_scrolling_down : (+ actions.toggle_selection actions.move_selection_worse) : (+ actions.toggle_selection actions.move_selection_better) -- cgit v1.2.3-70-g09d2 From 81bbfb329d7085b0bcd7435763116ee3f6784c4e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:32:13 +0200 Subject: Revert "fix(telescope): remove reults_scrolling_up" This reverts commit 568c1581b47ec27b6aaa1e5f5b7fab4bee180ed0. --- fnl/config/telescope.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl index af99d2d..d026052 100644 --- a/fnl/config/telescope.fnl +++ b/fnl/config/telescope.fnl @@ -50,8 +50,8 @@ : actions.preview_scrolling_up : actions.preview_scrolling_down - ;; : actions.results_scrolling_up - ;; : actions.results_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down : (+ actions.toggle_selection actions.move_selection_worse) : (+ actions.toggle_selection actions.move_selection_better) -- cgit v1.2.3-70-g09d2 From dcaead946f1c45573c792cf5d8282829c96d4134 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:35:15 +0200 Subject: fix(options): add missing arg --- fnl/settings/options.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index f011eb9..1526856 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -48,4 +48,4 @@ (set vim.cmd [[set iskeyword+=-]]) (set vim.cmd [[set formatoptions-=cro]]) (set nvim.ex.set "shortmess+=c") -(apply-opts) +(apply-opts opts) -- cgit v1.2.3-70-g09d2 From b173e4a1a1e3f710cf304e726cdea6c7bf793c26 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:49:35 +0200 Subject: fix(lsp installer): add let for handlers --- fnl/config/lsp/lsp-installer.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index f77a4be..fd2271d 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -3,8 +3,9 @@ {autoload {util util}}) (def- opts - {:on_attach: (require :config.lsp.handlers).on_attach - :capabilities (require :config.lsp.handlers).capabilities}) + (let [handlers (require :config.lsp.handlers)] + {:on_attach: handlers.on_attach + :capabilities handlers.capabilities})) (defn- get-server-opts [server] (when (= server.name :jsonls) -- cgit v1.2.3-70-g09d2 From 5457261051476c9909cc54674c6e00134bda650d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:49:56 +0200 Subject: fix(nvim tree): typo for tree config --- fnl/config/nvim-tree.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl index 9e0945f..eb579f7 100644 --- a/fnl/config/nvim-tree.fnl +++ b/fnl/config/nvim-tree.fnl @@ -24,7 +24,7 @@ (let [nvim-tree (util.load-plugin :nvim-tree) nvim-tree-config (util.load-plugin :nvim-tree.config)] - (let [tree-cb nvim_tree_config.nvim_tree_callback] + (let [tree-cb nvim-tree-config.nvim_tree_callback] (nvim-tree.setup {:auto_reload_on_write true :disable_netrw false -- cgit v1.2.3-70-g09d2 From 15e03fc018f4fc3a2429f1fb083ba0efdb959702 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 12:58:25 +0200 Subject: fix(bootstrap): move from lua folder --- bootstrap.lua | 29 +++++++++++++++++++++++++++++ lua/bootstrap.lua | 29 ----------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 bootstrap.lua delete mode 100644 lua/bootstrap.lua diff --git a/bootstrap.lua b/bootstrap.lua new file mode 100644 index 0000000..ab84c17 --- /dev/null +++ b/bootstrap.lua @@ -0,0 +1,29 @@ +-- Bootstrap nvim with essential plugins. + +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command + +local function ensure(user, repository) + local packer_path = fn.stdpath "data" .. "/site/pack" + local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute( + fmt( + "!git clone --depth 1 https://github.com/%s/%s %s", + user, + repository, + ensure_path + ) + ) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") + +-- Enable faster loading with impatient +require "impatient" diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua deleted file mode 100644 index ab84c17..0000000 --- a/lua/bootstrap.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Bootstrap nvim with essential plugins. - -local fn = vim.fn -local fmt = string.format -local execute = vim.api.nvim_command - -local function ensure(user, repository) - local packer_path = fn.stdpath "data" .. "/site/pack" - local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) - if fn.empty(fn.glob(ensure_path)) > 0 then - execute( - fmt( - "!git clone --depth 1 https://github.com/%s/%s %s", - user, - repository, - ensure_path - ) - ) - execute(fmt("packadd %s", repository)) - end -end - --- Bootstrap install essential modules if not present -ensure("wbthomason", "packer.nvim") -ensure("Olical", "aniseed") -ensure("lewis6991", "impatient.nvim") - --- Enable faster loading with impatient -require "impatient" -- cgit v1.2.3-70-g09d2 From 3d6ede542c7cd70b91eae7a88533e5a5a058787b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 21:12:18 +0200 Subject: fix(lsp installer): typo in name --- fnl/config/lsp/lsp-installer.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index fd2271d..116f637 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -19,7 +19,7 @@ (vim.tbl_deep_extend :force pyright-opts opts)))) -(let [lsp-installer (util.load-plugin :lsp-installer)] +(let [lsp-installer (util.load-plugin :nvim-lsp-installer)] (lsp-installer.on_server_ready (fn [server] (let [opts (get-server-opts server)] (server:setup opts))))) -- cgit v1.2.3-70-g09d2 From 8cb8e9106007d811d9dc079b40a8768d060ad754 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 9 Apr 2022 21:34:32 +0200 Subject: fix(zen): name --- fnl/config/zen.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl index 411b664..e17d5d3 100644 --- a/fnl/config/zen.fnl +++ b/fnl/config/zen.fnl @@ -1,5 +1,5 @@ ;; Zen mode. -(module config.zen-mode +(module config.zen {autoload {util util}}) (let [zen-mode (util.load-plugin :zen-mode)] -- cgit v1.2.3-70-g09d2 From f23947ea37ab8e82b0536e55e2187b05f5340767 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 15:23:48 +0200 Subject: fix(util): add nvim loading --- fnl/util.fnl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index 4ee8f8e..a773b6e 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -1,5 +1,6 @@ ;; Utility functions. -(module util) +(module util + {autoload {nvim aniseed.nvim}}) (defn autocmd [name opts] (nvim.create_autocmd name opts)) -- cgit v1.2.3-70-g09d2 From 2db66aee1a42c6cce68933f6637d74691afc4aec Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 15:23:57 +0200 Subject: fix(init): load autocmd --- fnl/config/init.fnl | 1 + 1 file changed, 1 insertion(+) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index fb80ebc..5b494b0 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -3,6 +3,7 @@ {require {_ config.packer _ config.alpha + _ config.autocmd _ config.autopairs _ config.better-escape _ config.bufferline -- cgit v1.2.3-70-g09d2 From 7df95b28f6f344e5d5e75ef57bee3babe93fa7be Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 15:24:17 +0200 Subject: fix(autocmd): remove unused plugins --- fnl/config/autocmd.fnl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index 1f90f8e..c5e7ae5 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -1,8 +1,6 @@ ;; A customizable greeter. (module config.autocmd - {autoload {util util - nvim aniseed.nvim - a aniseed.core}}) + {autoload {util util}}) (util.autocmd :FileType -- cgit v1.2.3-70-g09d2 From 426b21829e1304b3e7c545be4743e9b89424eddc Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 15:52:40 +0200 Subject: fix(util): nvim ex autocmd --- fnl/util.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index a773b6e..5397270 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -3,7 +3,7 @@ {autoload {nvim aniseed.nvim}}) (defn autocmd [name opts] - (nvim.create_autocmd name opts)) + (nvim.ex.autocmd name opts)) (defn load-plugin [name] (let [(ok? val-or-err) (pcall require name)] -- cgit v1.2.3-70-g09d2 From 05d5708b87b9c3f3630fb079285829959ea624ef Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 17:18:58 +0200 Subject: fix(install): install table, still wip --- fnl/install.fnl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 65e2b8b..39948b8 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -6,9 +6,10 @@ packer packer}}) (defn- install-plugins [...] - (each [plugin opts (pairs [...])] + (let [plgs ...] (packer.startup ( fn [use] - (use (a.assoc opts 1 plugin)))))) + (each [plugin opts (pairs plgs)] + (use (a.assoc opts 1 plugin))))))) -(install-plugins plugins) +(install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From e0fc0fff5c91cb3a5260b0071a2492faf200d504 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 17:58:21 +0200 Subject: fix(install): wip --- fnl/install.fnl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 39948b8..d6eef2c 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -5,11 +5,10 @@ plugins plugins packer packer}}) -(defn- install-plugins [...] - (let [plgs ...] - (packer.startup ( - fn [use] - (each [plugin opts (pairs plgs)] - (use (a.assoc opts 1 plugin))))))) +(defn- install-plugins [plgs] + (packer.startup ( + fn [use] + (each [plugin opts (pairs plgs)] + (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From a8ef65821f7fd7e2cdae39579e4a7dfabd75e58a Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:33:20 +0200 Subject: docs(readme): add todo --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 72ae13b..44b5df1 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,7 @@ fnm and node for lsp    ├── plugins.lua # Table of all plugins. └── settings # Neovim settings. ``` + +## TODO +-[ ] autocmd +-[ ] cmp check if anything is missing -- cgit v1.2.3-70-g09d2 From be910efb9e059a962cffc030dec7ea1ea3771e7c Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:34:21 +0200 Subject: fix(lsp): remove do add opts return --- fnl/config/lsp/handlers.fnl | 27 ++++++++++++++------------- fnl/config/lsp/init.fnl | 5 ++--- fnl/config/lsp/lsp-installer.fnl | 5 +++-- fnl/config/lsp/null-ls.fnl | 4 ++-- fnl/config/lsp/settings/pyright.fnl | 2 -- fnl/config/lsp/settings/sumneko-lua.fnl | 2 -- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index 6c3566e..950f3fb 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -29,22 +29,21 @@ :prefix ""}}) (defn setup [] - (do - (apply-signs) - (vim.diagnostic.config config) - (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) - (set vim.lsp.handlers.textDocument/signatureHelp (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} )))) + (apply-signs) + (vim.diagnostic.config config) + (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) + (set vim.lsp.handlers.textDocument/signatureHelp + (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} ))) (defn- lsp-keymaps [bufnr] (let [opts { :noremap true :silent true }] - (do - (nvim.buf_set_keymap bufnr :n :gD "lua vim.lsp.buf.declaration()" opts) - (nvim.buf_set_keymap bufnr :n :gd "lua vim.lsp.buf.definition()" opts) - (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" opts) - (nvim.buf_set_keymap bufnr :n :gI "lua vim.lsp.buf.implementation()" opts) - (nvim.buf_set_keymap bufnr :n :gr "lua vim.lsp.buf.references()" opts) - (nvim.buf_set_keymap bufnr :n :gl "lua vim.diagnostic.open_float()" opts) - (nvim.buf_set_keymap bufnr :n :q "lua vim.diagnostic.setloclist()" opts)))) + (nvim.buf_set_keymap bufnr :n :gD "lua vim.lsp.buf.declaration()" opts) + (nvim.buf_set_keymap bufnr :n :gd "lua vim.lsp.buf.definition()" opts) + (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" opts) + (nvim.buf_set_keymap bufnr :n :gI "lua vim.lsp.buf.implementation()" opts) + (nvim.buf_set_keymap bufnr :n :gr "lua vim.lsp.buf.references()" opts) + (nvim.buf_set_keymap bufnr :n :gl "lua vim.diagnostic.open_float()" opts) + (nvim.buf_set_keymap bufnr :n :q "lua vim.diagnostic.setloclist()" opts))) (defn on-attach [client bufnr] (if (= client.name :html) @@ -57,3 +56,5 @@ (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] (cmp-nvim-lsp.update_capabilities capabilities)) capabilities)) + +(setup) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl index aa61f61..b26dd7a 100644 --- a/fnl/config/lsp/init.fnl +++ b/fnl/config/lsp/init.fnl @@ -3,7 +3,6 @@ {autoload {util util}}) (let [_ (util.load-plugin :lspconfig)] - (do (require :config.lsp.lsp-installer) - ((require :config.lsp.handlers).setup) - (require :config.lsp.null-ls))) + (require :config.lsp.handlers) + (require :config.lsp.null-ls)) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index 116f637..3649566 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -13,10 +13,11 @@ (vim.tbl_deep_extend :force jsonls-opts opts))) (when (= server.name :sumneko_lua) (let [sumneko-lua-opts (require :config.lsp.settings.sumneko-lua)] - (vim.tbl_deep_extend :force sumneko-lua-opts opts))) + (vim.tbl_deep_extend :force sumneko-lua-opts.settings opts))) (when (= server.name :pyright) (let [pyright-opts (require :config.lsp.settings.pyright)] - (vim.tbl_deep_extend :force pyright-opts opts)))) + (vim.tbl_deep_extend :force pyright-opts.settings opts))) + opts) (let [lsp-installer (util.load-plugin :nvim-lsp-installer)] diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index d1f1af1..c5b4aef 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -13,14 +13,14 @@ diagnostics.jsonlint diagnostics.shellcheck diagnostics.yamllint - (formatting.black.with { extra_args [ "--fast" ] }) + (formatting.black.with { :extra_args [ "--fast" ] }) formatting.erlfmt formatting.fourmolu formatting.gofmt formatting.goimports formatting.nixfmt (formatting.prettier.with { - extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] + :extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] }) formatting.rustfmt formatting.shfmt diff --git a/fnl/config/lsp/settings/pyright.fnl b/fnl/config/lsp/settings/pyright.fnl index 369fa36..bb39ab5 100644 --- a/fnl/config/lsp/settings/pyright.fnl +++ b/fnl/config/lsp/settings/pyright.fnl @@ -6,5 +6,3 @@ {:python {:analysis {:typeCheckingMode "off"}}}}) - -(settings) diff --git a/fnl/config/lsp/settings/sumneko-lua.fnl b/fnl/config/lsp/settings/sumneko-lua.fnl index 5498f7e..e39c801 100644 --- a/fnl/config/lsp/settings/sumneko-lua.fnl +++ b/fnl/config/lsp/settings/sumneko-lua.fnl @@ -17,5 +17,3 @@ :Lua { :diagnostics diagnostics :workspace workspace}}}) - -(settings) -- cgit v1.2.3-70-g09d2 From 0189ebed5c2212120066662da68cfcacb9b6783f Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:34:40 +0200 Subject: fix(better-escape): typo --- fnl/config/better-escape.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl index e486927..2351187 100644 --- a/fnl/config/better-escape.fnl +++ b/fnl/config/better-escape.fnl @@ -3,7 +3,7 @@ {autoload {util util}}) -(let [better-escape (util.load-plugin :better-escape)] +(let [better-escape (util.load-plugin :better_escape)] (better-escape.setup { :mapping ["jk" "jj"] :timeout vim.o.timeoutlen -- cgit v1.2.3-70-g09d2 From a1d289f9c1c4172469fad4defdd6dea8cf6e5ac7 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:34:57 +0200 Subject: fix(cmp): remove lazy load --- fnl/config/cmp.fnl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index 3c1ac1d..34cc026 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -7,8 +7,7 @@ (let [cmp (util.load-plugin :cmp) lspkind (util.load-plugin :lspkind) luasnip (util.load-plugin :luasnip)] - (do - ((require :luasnip/loaders/from_vscode).lazy_load) + ;;((require :luasnip/loaders/from_vscode).lazy_load) (lspkind.init) (cmp.setup { :snippet { @@ -36,4 +35,4 @@ :border [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]} :experimental { :ghost_text false - :native_menu false}}))) + :native_menu false}})) -- cgit v1.2.3-70-g09d2 From 69414bcd6448dfdc17b386c287eacdaab3a70af5 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:35:20 +0200 Subject: fix(colorscheme): add vim.cmd --- fnl/config/colorscheme.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/config/colorscheme.fnl b/fnl/config/colorscheme.fnl index 31323d7..828daf1 100644 --- a/fnl/config/colorscheme.fnl +++ b/fnl/config/colorscheme.fnl @@ -4,6 +4,6 @@ (local colorscheme "no-clown-fiesta") -(let [(ok? _) (pcall (.. "colorscheme " colorscheme))] - (when (not ok?) +(let [(ok? _) (pcall (vim.cmd (.. "colorscheme " "no-clown-fiesta")))] + (if (not ok?) (vim.notify (.. "colorscheme " colorscheme " not found!")))) -- cgit v1.2.3-70-g09d2 From 9919722bd4f7ecb0d4507322c3321d0ca56b2e8d Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:35:50 +0200 Subject: fix(config init): comment out autocmd --- fnl/config/init.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index 5b494b0..d1a2ef8 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -3,7 +3,7 @@ {require {_ config.packer _ config.alpha - _ config.autocmd + ;;_ config.autocmd _ config.autopairs _ config.better-escape _ config.bufferline @@ -21,5 +21,6 @@ _ config.treesitter _ config.which-key _ config.zen - _ config.lsp}}) + _ config.lsp + }}) -- cgit v1.2.3-70-g09d2 From ae487e0ee6e2b29908ec7df5807120556f6410cf Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:36:05 +0200 Subject: fix(lualine): change table type --- fnl/config/lualine.fnl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index 8f12049..68f2f4f 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -42,9 +42,9 @@ } :sections { :lualine_a [ "mode" ] - :lualine_b { 1 branch 2 "filename" } - :lualine_c { 1 diff } - :lualine_x { 1 diagnostics 2 filetype } + :lualine_b [ branch "filename" ] + :lualine_c [ diff ] + :lualine_x [ diagnostics filetype ] :lualine_y {} :lualine_z [ "location" "progress" "encoding" ] } -- cgit v1.2.3-70-g09d2 From c657176b6acee15491288ade9b41384a3c98c09e Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:36:21 +0200 Subject: fix(telescope): remove do --- fnl/config/telescope.fnl | 164 +++++++++++++++++++++++------------------------ 1 file changed, 81 insertions(+), 83 deletions(-) diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl index d026052..86f5f5c 100644 --- a/fnl/config/telescope.fnl +++ b/fnl/config/telescope.fnl @@ -3,98 +3,96 @@ {autoload {util util}}) (let [telescope (util.load-plugin :telescope)] - (do - (let [actions (require :telescope.actions)] - (telescope.setup { - :defaults { - :prompt_prefix " " - :selection_caret " " - :path_display [ "smart" ] - :initial_mode "insert" - :selection_strategy "reset" - :sorting_strategy "ascending" - :layout_strategy "horizontal" - :layout_config { - :prompt_position "top" - :preview_cutoff 120 - :horizontal { mirror false } - :vertical { mirror false }} - :vimgrep_arguments [ - "rg" - "--color=never" - "--no-heading" - "--with-filename" - "--line-number" - "--column" - "--smart-case" - "--hidden" - ] - :mappings { - :i { - : actions.cycle_history_next - : actions.cycle_history_prev + (let [actions (require :telescope.actions)] + (telescope.setup { + :defaults { + :prompt_prefix " " + :selection_caret " " + :path_display [ "smart" ] + :initial_mode "insert" + :selection_strategy "reset" + :sorting_strategy "ascending" + :layout_strategy "horizontal" + :layout_config { + :prompt_position "top" + :preview_cutoff 120 + :horizontal { :mirror false } + :vertical { :mirror false }} + :vimgrep_arguments [ + "rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + "--hidden" + ] + :mappings { + :i { + : actions.cycle_history_next + : actions.cycle_history_prev - : actions.move_selection_next - : actions.move_selection_previous + : actions.move_selection_next + : actions.move_selection_previous - : actions.close + : actions.close - : actions.move_selection_next - : actions.move_selection_previous + : actions.move_selection_next + : actions.move_selection_previous + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab + : actions.preview_scrolling_up + : actions.preview_scrolling_down - : actions.preview_scrolling_up - : actions.preview_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down + : (+ actions.toggle_selection actions.move_selection_worse) + : (+ actions.toggle_selection actions.move_selection_better) + : (+ actions.send_to_qflist actions.open_qflist) + : (+ actions.send_selected_to_qflist actions.open_qflist) + : actions.complete_tag + : actions.which_key} + :n { + : actions.close + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab - : (+ actions.toggle_selection actions.move_selection_worse) - : (+ actions.toggle_selection actions.move_selection_better) - : (+ actions.send_to_qflist actions.open_qflist) - : (+ actions.send_selected_to_qflist actions.open_qflist) - : actions.complete_tag - : actions.which_key} - :n { - : actions.close - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab + : (+ actions.toggle_selection actions.move_selection_worse) + : (+ actions.toggle_selection actions.move_selection_better) + : (+ actions.send_to_qflist actions.open_qflist) + : (+ actions.send_selected_to_qflist actions.open_qflist) - : (+ actions.toggle_selection actions.move_selection_worse) - : (+ actions.toggle_selection actions.move_selection_better) - : (+ actions.send_to_qflist actions.open_qflist) - : (+ actions.send_selected_to_qflist actions.open_qflist) + :j actions.move_selection_next + :k actions.move_selection_previous + :H actions.move_to_top + :M actions.move_to_middle + :L actions.move_to_bottom - :j actions.move_selection_next - :k actions.move_selection_previous - :H actions.move_to_top - :M actions.move_to_middle - :L actions.move_to_bottom + : actions.move_selection_next + : actions.move_selection_previous + :gg actions.move_to_top + :G actions.move_to_bottom - : actions.move_selection_next - : actions.move_selection_previous - :gg actions.move_to_top - :G actions.move_to_bottom + : actions.preview_scrolling_up + : actions.preview_scrolling_down - : actions.preview_scrolling_up - : actions.preview_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down - - :? actions.which_key}}} - :extensions { - :fzf { - :fuzzy true - :override_generic_sorter true - :override_file_sorter true - :case_mode "smart_case"}}}) - (telescope.load_extension :fzf) - (telescope.load_extension :file_browser) - (telescope.load_extension :project)))) + :? actions.which_key}}} + :extensions { + :fzf { + :fuzzy true + :override_generic_sorter true + :override_file_sorter true + :case_mode "smart_case"}}}) + (telescope.load_extension :fzf) + (telescope.load_extension :file_browser) + (telescope.load_extension :projects))) -- cgit v1.2.3-70-g09d2 From d120046ac47aeab5bca42353d687503be693c7eb Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:36:35 +0200 Subject: fix(treesitter); typo --- fnl/config/treesitter.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index f88a8b9..f265533 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -3,7 +3,7 @@ (module config.treesitter {autoload {util util}}) -(let [treesitter (util.load-plugin :nvim-treesitter.config)] +(let [treesitter (util.load-plugin :nvim-treesitter.configs)] (treesitter.setup {:ensure_installed "maintained" :sync_install false -- cgit v1.2.3-70-g09d2 From 38bad2e982ee2d69229c2700cdfb62ef382832fc Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:36:48 +0200 Subject: fix(which-key): typo --- fnl/config/which-key.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 7c5cf71..8c01ae6 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -169,7 +169,7 @@ "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())" "Comment" ]}) -(let [which-key (util.load-plugin :nvim-which-key.config)] +(let [which-key (util.load-plugin :which-key)] (do (which-key.setup setup) (which-key.register mappings opts) -- cgit v1.2.3-70-g09d2 From d76a6d97c50b7a4a9ffe9668ede7430a80facde6 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:41:23 +0200 Subject: fix(treesitter): install all --- fnl/config/treesitter.fnl | 2 +- fnl/settings/init.fnl | 6 ++++-- fnl/settings/options.fnl | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index f265533..357859f 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -5,7 +5,7 @@ (let [treesitter (util.load-plugin :nvim-treesitter.configs)] (treesitter.setup - {:ensure_installed "maintained" + {:ensure_installed "all" :sync_install false :ignore_install [ "" ] :autopairs { :enable true } diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl index 5c21629..77e2caa 100644 --- a/fnl/settings/init.fnl +++ b/fnl/settings/init.fnl @@ -1,4 +1,6 @@ ;; Load nvim settings (module settings - {require {_ settings.options - _ settings.keymaps}}) + {require { + _ settings.options + _ settings.keymaps + }}) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 1526856..02d6275 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -40,12 +40,12 @@ } ) -(defn- apply-opts [...] - (each [k v (pairs ...)] +(defn- apply-opts [] + (each [k v (pairs opts)] (tset vim.opt k v))) -(set vim.cmd "set whichwrap+=<,>,[,],h,l") -(set vim.cmd [[set iskeyword+=-]]) -(set vim.cmd [[set formatoptions-=cro]]) -(set nvim.ex.set "shortmess+=c") +(vim.cmd "set whichwrap+=<,>,[,],h,l") +(vim.cmd "set iskeyword+=-") +(vim.cmd "set formatoptions-=cro") +(nvim.ex.set "shortmess+=c") (apply-opts opts) -- cgit v1.2.3-70-g09d2 From f5c7d68ca36f3ecd06b02da31283612bd7bc5f56 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:41:57 +0200 Subject: fix(settings): remove opts as arg --- fnl/settings/init.fnl | 6 ++---- fnl/settings/options.fnl | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl index 77e2caa..5c21629 100644 --- a/fnl/settings/init.fnl +++ b/fnl/settings/init.fnl @@ -1,6 +1,4 @@ ;; Load nvim settings (module settings - {require { - _ settings.options - _ settings.keymaps - }}) + {require {_ settings.options + _ settings.keymaps}}) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 02d6275..4e560ce 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -44,8 +44,8 @@ (each [k v (pairs opts)] (tset vim.opt k v))) +(apply-opts) (vim.cmd "set whichwrap+=<,>,[,],h,l") (vim.cmd "set iskeyword+=-") (vim.cmd "set formatoptions-=cro") (nvim.ex.set "shortmess+=c") -(apply-opts opts) -- cgit v1.2.3-70-g09d2 From fe73b42ee804bce78e09d419d4996703644702d2 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:42:30 +0200 Subject: refactor(init): move settings before install --- fnl/init.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index 7f5089b..bd91031 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,5 +1,5 @@ ;; Install, load settings, and load plugin configs. (module init - {require {_ install - _ settings + {require {_ settings + _ install _ config}}) -- cgit v1.2.3-70-g09d2 From 4c7fab72da35ef7a27da0818ae8fc9d952180971 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:42:45 +0200 Subject: fix(plugins): typos --- fnl/plugins.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 5caf7e8..3994ba7 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -18,7 +18,7 @@ :hrsh7th/cmp-path {} ;; path completions :hrsh7th/cmp-cmdline {} ;; cmdline completions :saadparwaiz1/cmp_luasnip {} ;; snippet completions - :onsails:lspkind-nvim {} + :onsails/lspkind-nvim {} :hrsh7th/cmp-nvim-lsp {} :neovim/nvim-lspconfig {} :williamboman/nvim-lsp-installer {} @@ -49,7 +49,7 @@ :akinsho/bufferline.nvim {} :moll/vim-bbye {} - :nvim-lualine/lualine.nvim { :requires "kyazdani42/nvim-web-devicons" :opt true } + :nvim-lualine/lualine.nvim { :requires { 1 "kyazdani42/nvim-web-devicons" :opt true }} :ahmedkhalf/project.nvim {} :goolord/alpha-nvim {} :antoinemadec/FixCursorHold.nvim {} ;; This is needed to fix lsp doc highlight -- cgit v1.2.3-70-g09d2 From 021b9b7dd7258d6c3472bdfe1026fddd0ce6d989 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:42:56 +0200 Subject: fix(util): wip --- fnl/util.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index 5397270..18345ad 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -3,7 +3,7 @@ {autoload {nvim aniseed.nvim}}) (defn autocmd [name opts] - (nvim.ex.autocmd name opts)) + (nvim.ex.create_autocmd name opts)) (defn load-plugin [name] (let [(ok? val-or-err) (pcall require name)] -- cgit v1.2.3-70-g09d2 From 274648011686b1c822e63b03bdcc6f2ce8e9b41e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 10 Apr 2022 23:54:26 +0200 Subject: feat: add gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f19f9e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/lua -- cgit v1.2.3-70-g09d2 From b74c9dd22e632bbe720587db92966c4d6811b766 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 18:52:34 +0200 Subject: style: format with fnlfmt --- fnl/config/alpha.fnl | 61 ++++--- fnl/config/autocmd.fnl | 117 ++++++------- fnl/config/autopairs.fnl | 40 ++--- fnl/config/better-escape.fnl | 13 +- fnl/config/bufferline.fnl | 166 +++++++------------ fnl/config/cmp.fnl | 60 +++---- fnl/config/colorizer.fnl | 3 +- fnl/config/colorscheme.fnl | 9 +- fnl/config/gitsigns.fnl | 110 +++++-------- fnl/config/hop.fnl | 8 +- fnl/config/impatient.fnl | 3 +- fnl/config/init.fnl | 46 +++--- fnl/config/lsp/handlers.fnl | 117 ++++++------- fnl/config/lsp/init.fnl | 9 +- fnl/config/lsp/lsp-installer.fnl | 34 ++-- fnl/config/lsp/null-ls.fnl | 47 +++--- fnl/config/lsp/settings/jsonls.fnl | 22 +-- fnl/config/lsp/settings/pyright.fnl | 6 +- fnl/config/lsp/settings/sumneko-lua.fnl | 30 ++-- fnl/config/lualine.fnl | 92 +++++------ fnl/config/ncomment.fnl | 34 ++-- fnl/config/nvim-tree.fnl | 175 +++++++++----------- fnl/config/orgmode.fnl | 23 +-- fnl/config/packer.fnl | 10 +- fnl/config/project.fnl | 28 ++-- fnl/config/spectre.fnl | 157 +++++++----------- fnl/config/telescope.fnl | 167 +++++++++---------- fnl/config/treesitter.fnl | 27 ++- fnl/config/which-key.fnl | 281 +++++++++++++------------------- fnl/config/zen.fnl | 25 ++- fnl/init.fnl | 5 +- fnl/install.fnl | 13 +- fnl/plugins.fnl | 122 +++++++------- fnl/settings/init.fnl | 4 +- fnl/settings/keymaps.fnl | 47 +++--- fnl/settings/options.fnl | 115 ++++++++----- fnl/util.fnl | 15 +- 37 files changed, 996 insertions(+), 1245 deletions(-) diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl index 13a02c6..4fb51ec 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/config/alpha.fnl @@ -1,41 +1,40 @@ ;; A customizable greeter. -(module config.alpha - {autoload {util util}}) +(module config.alpha {autoload {util util}}) -(def- ascii-art [ - " ##############..... ############## " - " ##############......############## " - " ##########..........########## " - " ##########........########## " - " ##########.......########## " - " ##########.....##########.. " - " ##########....##########..... " - " ..##########..##########......... " - " ....##########.#########............. " - " ..################JJJ............ " - " ################............. " - " ##############.JJJ.JJJJJJJJJJ " - " ############...JJ...JJ..JJ JJ " - " ##########....JJ...JJ..JJ JJ " - " ########......JJJ..JJJ JJJ JJJ " - " ###### ......... " - " ..... " - " . " -]) +(def- ascii-art [" ##############..... ############## " + " ##############......############## " + " ##########..........########## " + " ##########........########## " + " ##########.......########## " + " ##########.....##########.. " + " ##########....##########..... " + " ..##########..##########......... " + " ....##########.#########............. " + " ..################JJJ............ " + " ################............. " + " ##############.JJJ.JJJJJJJJJJ " + " ############...JJ...JJ..JJ JJ " + " ##########....JJ...JJ..JJ JJ " + " ########......JJJ..JJJ JJJ JJJ " + " ###### ......... " + " ..... " + " . "]) (let [alpha (util.load-plugin :alpha)] (let [dashboard (require :alpha.themes.dashboard)] (do (set dashboard.section.header.val ascii-art) - (set dashboard.section.buttons.val [ - (dashboard.button "f" " Find file" ":Telescope file_browser ") - (dashboard.button "e" " New file" ":ene startinsert ") - (dashboard.button "p" " Find project" ":Telescope projects ") - (dashboard.button "r" " Recently used files" ":Telescope oldfiles ") - (dashboard.button "t" " Find text" ":Telescope live_grep ") - (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua ") - (dashboard.button "q" " Quit Neovim" ":qa") - ]) + (set dashboard.section.buttons.val + [(dashboard.button :f " Find file" + ":Telescope file_browser ") + (dashboard.button :e " New file" ":ene startinsert ") + (dashboard.button :p " Find project" ":Telescope projects ") + (dashboard.button :r " Recently used files" + ":Telescope oldfiles ") + (dashboard.button :t " Find text" ":Telescope live_grep ") + (dashboard.button :c " Configuration" + ":e ~/.config/nvim/init.lua ") + (dashboard.button :q " Quit Neovim" ":qa")]) (set dashboard.section.header.opts.hl :AlphaHeader) (set dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index c5e7ae5..ecec60a 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -1,69 +1,50 @@ ;; A customizable greeter. -(module config.autocmd - {autoload {util util}}) - -(util.autocmd - :FileType - {:pattern [ :qf :help :man :lspinfo ] - :command "nnoremap q :close" - :group :_general_settings}) - -(util.autocmd - :TextYankPost - {:pattern [ :* ] - :callback (lambda [] (vim.highlight.on_yank {:timeout 200})) - :group :_general_settings}) - -(util.autocmd - :BufWinEnter - {:pattern [ :* ] - :command ":set formatoptions-=cro" - :group :_general_settings}) - -(util.autocmd - :FileType - {:pattern [ :qf ] - :command "set nobuflisted" - :group :_general_settings}) - -(util.autocmd - :FileType - {:pattern [ :gitcommit ] - :command "setlocal wrap" - :group :_git}) - -(util.autocmd - :FileType - {:pattern [ :gitcommit ] - :command "setlocal spell" - :group :_git}) - -(util.autocmd - :FileType - {:pattern [ :markdown ] - :command "setlocal wrap" - :group :_markdown}) - -(util.autocmd - :FileType - {:pattern [ :markdown ] - :command "setlocal spell" - :group :_markdown}) - -(util.autocmd - :VimResized - {:pattern [ :* ] - :command "tabdo wincmd =" - :group :_auto_resize}) - -(util.autocmd - :User - {:pattern [ :AlphaReady ] - :command "set showtabline=0 | autocmd BufUnload set showtabline=2" - :group :_alpha}) - -(util.autocmd - :BufWritePost - {:pattern [ :plugins.fnl ] - :command "source | PackerSync" - :group :packer_user_config}) +(module config.autocmd {autoload {util util}}) + +(util.autocmd :FileType {:pattern [:qf :help :man :lspinfo] + :command "nnoremap q :close" + :group :_general_settings}) + +(util.autocmd :TextYankPost + {:pattern ["*"] + :callback (lambda [] + (vim.highlight.on_yank {:timeout 200})) + :group :_general_settings}) + +(util.autocmd :BufWinEnter + {:pattern ["*"] + :command ":set formatoptions-=cro" + :group :_general_settings}) + +(util.autocmd :FileType {:pattern [:qf] + :command "set nobuflisted" + :group :_general_settings}) + +(util.autocmd :FileType {:pattern [:gitcommit] + :command "setlocal wrap" + :group :_git}) + +(util.autocmd :FileType {:pattern [:gitcommit] + :command "setlocal spell" + :group :_git}) + +(util.autocmd :FileType {:pattern [:markdown] + :command "setlocal wrap" + :group :_markdown}) + +(util.autocmd :FileType {:pattern [:markdown] + :command "setlocal spell" + :group :_markdown}) + +(util.autocmd :VimResized {:pattern ["*"] + :command "tabdo wincmd =" + :group :_auto_resize}) + +(util.autocmd :User {:pattern [:AlphaReady] + :command "set showtabline=0 | autocmd BufUnload set showtabline=2" + :group :_alpha}) + +(util.autocmd :BufWritePost + {:pattern [:plugins.fnl] + :command "source | PackerSync" + :group :packer_user_config}) diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl index b2d0475..2b175fa 100644 --- a/fnl/config/autopairs.fnl +++ b/fnl/config/autopairs.fnl @@ -1,25 +1,21 @@ ;; Autopairs for brackets and quote symbols. -(module config.autopairs - {autoload {util util}}) +(module config.autopairs {autoload {util util}}) (let [npairs (util.load-plugin :nvim-autopairs)] - (npairs.setup { - :check_ts true - :ts_config { - :lua [ :string :source ] - :javascript [ :string :template_string ] - :java false - } - :disable_filetype [ :TelescopePrompt :spectre_panel ] - :fast_warp { - :map "" - :chars [ "{" "[" "(" "\"" "'" ] - :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") - :check_comma true - :highlight :PmenuSel - :highlight_grey :LineNr - :offset 0 - :end_key :$ - :keys :qwertyuiopzxcvbnmasdfghjkl - :highlight :PmenuSel - :highlight_grey :LineNr}})) + (npairs.setup {:check_ts true + :ts_config {:lua [:string :source] + :javascript [:string :template_string] + :java false} + :disable_filetype [:TelescopePrompt :spectre_panel] + :fast_warp {:map : + :chars ["{" "[" "(" "\"" "'"] + :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" + "") + :check_comma true + :highlight :PmenuSel + :highlight_grey :LineNr + :offset 0 + :end_key "$" + :keys :qwertyuiopzxcvbnmasdfghjkl + :highlight :PmenuSel + :highlight_grey :LineNr}})) diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl index 2351187..93ec0a9 100644 --- a/fnl/config/better-escape.fnl +++ b/fnl/config/better-escape.fnl @@ -1,11 +1,8 @@ ;; Better escape without nasty delay -(module config.better-escape - {autoload {util util}}) - +(module config.better-escape {autoload {util util}}) (let [better-escape (util.load-plugin :better_escape)] - (better-escape.setup { - :mapping ["jk" "jj"] - :timeout vim.o.timeoutlen - :clear_empty_lines false - :keys ""})) + (better-escape.setup {:mapping [:jk :jj] + :timeout vim.o.timeoutlen + :clear_empty_lines false + :keys :})) diff --git a/fnl/config/bufferline.fnl b/fnl/config/bufferline.fnl index f4ec98b..8e6d094 100644 --- a/fnl/config/bufferline.fnl +++ b/fnl/config/bufferline.fnl @@ -1,117 +1,69 @@ ;; Topbar that displays open buffers. -(module config.bufferline - {autoload {util util}}) +(module config.bufferline {autoload {util util}}) -(def- options - {:numbers "none" - :close_command "Bdelete! %d" - :right_mouse_command nil - :left_mouse_command nil - :middle_mouse_command nil - :indicator_icon "" - :buffer_close_icon "" - :modified_icon "●" - :close_icon "" - :left_trunc_marker "<" - :right_trunc_marker ">" - :max_name_length 30 - :max_prefix_length 30 - :tab_size 21 - :diagnostics false - :diagnostics_update_in_insert false - :offsets [ { :filetype "NvimTree" :text "" :padding 1 } ] - :show_buffer_icons false - :show_buffer_close_icons false - :show_close_icon false - :show_tab_indicators false - :persist_buffer_sort true - :separator_style "thin" - :enforce_regular_tabs true - :always_show_bufferline true}) +(def- options {:numbers :none + :close_command "Bdelete! %d" + :right_mouse_command nil + :left_mouse_command nil + :middle_mouse_command nil + :indicator_icon "" + :buffer_close_icon "" + :modified_icon "●" + :close_icon "" + :left_trunc_marker "<" + :right_trunc_marker ">" + :max_name_length 30 + :max_prefix_length 30 + :tab_size 21 + :diagnostics false + :diagnostics_update_in_insert false + :offsets [{:filetype :NvimTree :text "" :padding 1}] + :show_buffer_icons false + :show_buffer_close_icons false + :show_close_icon false + :show_tab_indicators false + :persist_buffer_sort true + :separator_style :thin + :enforce_regular_tabs true + :always_show_bufferline true}) -(def- default-bg-tabline { - :attribute "bg" :highlight "TabLine"}) +(def- default-bg-tabline {:attribute :bg :highlight :TabLine}) -(def- default-bg-normal { - :attribute "bg" :highlight "Normal"}) +(def- default-bg-normal {:attribute :bg :highlight :Normal}) -(def- default-fg-tabline { - :attribute "fg" :highlight "TabLine"}) +(def- default-fg-tabline {:attribute :fg :highlight :TabLine}) -(def- default-fg-normal { - :attribute "fg" :highlight "Normal"}) +(def- default-fg-normal {:attribute :fg :highlight :Normal}) (def- highlights - {:fill { - :guifg { :attribute "fg" :highlight "#ff0000" } - :guibg default-bg-tabline - } - :background { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :buffer_visible { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :close_button { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :close_button_visible { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :tab_selected { - :guifg default-fg-normal - :guibg default-bg-normal - } - :tab { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :tab_close { - :guifg { :attribute "fg" :highlight "TabLineSel" } - :guibg default-bg-normal - } - :duplicate_selected { - :guifg { :attribute "fg" :highlight "TabLineSel" } - :guibg { :attribute "bg" :highlight "TabLineSel" } - :gui "italic" - } - :duplicate_visible { - :guifg default-fg-tabline - :guibg default-bg-tabline - :gui "italic" - } - :duplicate { - :guifg default-fg-tabline - :guibg default-bg-tabline - :gui "italic" - } - :modified { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :modified_selected { - :guifg default-fg-normal - :guibg default-bg-normal - } - :modified_visible { - :guifg default-fg-tabline - :guibg default-bg-tabline - } - :separator { - :guifg default-bg-tabline - :guibg default-bg-tabline - } - :separator_selected { - :guifg default-bg-normal - :guibg default-bg-normal - } - :indicator_selected { - :guifg { :attribute "fg" :highlight "LspDiagnosticsDefaultHint" } - :guibg default-bg-normal}}) + {:fill {:guifg {:attribute :fg :highlight "#ff0000"} + :guibg default-bg-tabline} + :background {:guifg default-fg-tabline :guibg default-bg-tabline} + :buffer_visible {:guifg default-fg-tabline :guibg default-bg-tabline} + :close_button {:guifg default-fg-tabline :guibg default-bg-tabline} + :close_button_visible {:guifg default-fg-tabline + :guibg default-bg-tabline} + :tab_selected {:guifg default-fg-normal :guibg default-bg-normal} + :tab {:guifg default-fg-tabline :guibg default-bg-tabline} + :tab_close {:guifg {:attribute :fg :highlight :TabLineSel} + :guibg default-bg-normal} + :duplicate_selected {:guifg {:attribute :fg :highlight :TabLineSel} + :guibg {:attribute :bg :highlight :TabLineSel} + :gui :italic} + :duplicate_visible {:guifg default-fg-tabline + :guibg default-bg-tabline + :gui :italic} + :duplicate {:guifg default-fg-tabline + :guibg default-bg-tabline + :gui :italic} + :modified {:guifg default-fg-tabline :guibg default-bg-tabline} + :modified_selected {:guifg default-fg-normal :guibg default-bg-normal} + :modified_visible {:guifg default-fg-tabline :guibg default-bg-tabline} + :separator {:guifg default-bg-tabline :guibg default-bg-tabline} + :separator_selected {:guifg default-bg-normal :guibg default-bg-normal} + :indicator_selected {:guifg {:attribute :fg + :highlight :LspDiagnosticsDefaultHint} + :guibg default-bg-normal}}) (let [bufferline (util.load-plugin :bufferline)] - (bufferline.setup {:options options :highlights highlights})) + (bufferline.setup {: options : highlights})) diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index 34cc026..e4e16da 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -1,38 +1,32 @@ ;; Configuration for completion plugin. -(module config.cmp - {autoload {nvim aniseed.nvim - util util}}) - +(module config.cmp {autoload {nvim aniseed.nvim util util}}) (let [cmp (util.load-plugin :cmp) lspkind (util.load-plugin :lspkind) luasnip (util.load-plugin :luasnip)] - ;;((require :luasnip/loaders/from_vscode).lazy_load) - (lspkind.init) - (cmp.setup { - :snippet { - :expand (fn [args] - (luasnip.lsp_expand args.body))} - :mapping { - "" (cmp.mapping.select_prev_item) - "" (cmp.mapping.select_next_item)} - :sources [ - {:name "nvim_lsp"} - {:name "nvim_lua"} - {:name "luasnip"} - {:name "buffer" :keyword_length 4} - {:name "path" :keyword_length 6}] - :formatting {:format (lspkind.cmp_format { - :with_text true - :menu { - :buffer "[Buf]" - :nvim_lsp "[LSP]" - :nvim_lua "[api]" - :path "[path]" - :luasnip "[Snip]" - }})} - :documentation { - :border [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]} - :experimental { - :ghost_text false - :native_menu false}})) + ;;((require :luasnip/loaders/from_vscode).lazy_load) + (lspkind.init) + (cmp.setup {:snippet {:expand (fn [args] + (luasnip.lsp_expand args.body))} + :mapping {: (cmp.mapping.select_prev_item) + : (cmp.mapping.select_next_item)} + :sources [{:name :nvim_lsp} + {:name :nvim_lua} + {:name :luasnip} + {:name :buffer :keyword_length 4} + {:name :path :keyword_length 6}] + :formatting {:format (lspkind.cmp_format {:with_text true + :menu {:buffer "[Buf]" + :nvim_lsp "[LSP]" + :nvim_lua "[api]" + :path "[path]" + :luasnip "[Snip]"}})} + :documentation {:border ["╭" + "─" + "╮" + "│" + "╯" + "─" + "╰" + "│"]} + :experimental {:ghost_text false :native_menu false}})) diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl index 7118388..4d0b381 100644 --- a/fnl/config/colorizer.fnl +++ b/fnl/config/colorizer.fnl @@ -1,6 +1,5 @@ ;; Enables colorization of color codes in source files. -(module config.colorizer - {autoload {util util}}) +(module config.colorizer {autoload {util util}}) (let [colorizer (util.load-plugin :colorizer)] (colorizer.setup)) diff --git a/fnl/config/colorscheme.fnl b/fnl/config/colorscheme.fnl index 828daf1..989ee75 100644 --- a/fnl/config/colorscheme.fnl +++ b/fnl/config/colorscheme.fnl @@ -1,9 +1,8 @@ ;; Load neovim colorscheme. -(module config.colorscheme - {autoload {util util}}) +(module config.colorscheme {autoload {util util}}) -(local colorscheme "no-clown-fiesta") +(local colorscheme :no-clown-fiesta) -(let [(ok? _) (pcall (vim.cmd (.. "colorscheme " "no-clown-fiesta")))] +(let [(ok? _) (pcall (vim.cmd (.. "colorscheme " :no-clown-fiesta)))] (if (not ok?) - (vim.notify (.. "colorscheme " colorscheme " not found!")))) + (vim.notify (.. "colorscheme " colorscheme " not found!")))) diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl index d179e3e..07b9157 100644 --- a/fnl/config/gitsigns.fnl +++ b/fnl/config/gitsigns.fnl @@ -1,70 +1,48 @@ ;; Add git signs to source files. -(module config.gitsigns - {autoload {util util}}) +(module config.gitsigns {autoload {util util}}) -(def- signs { - :add { - :hl "GitSignsAdd" - :text "▎" - :numhl "GitSignsAddNr" - :linehl "GitSignsAddLn" - } - :change { - :hl "GitSignsChange" - :text "▎" - :numhl "GitSignsChangeNr" - :linehl "GitSignsChangeLn" - } - :delete { - :hl "GitSignsDelete" - :text "契" - :numhl "GitSignsDeleteNr" - :linehl "GitSignsDeleteLn" - } - :topdelete { - :hl "GitSignsDelete" - :text "契" - :numhl "GitSignsDeleteNr" - :linehl "GitSignsDeleteLn" - } - :changedelete { - :hl "GitSignsChange" - :text "▎" - :numhl "GitSignsChangeNr" - :linehl "GitSignsChangeLn"}}) +(def- signs {:add {:hl :GitSignsAdd + :text "▎" + :numhl :GitSignsAddNr + :linehl :GitSignsAddLn} + :change {:hl :GitSignsChange + :text "▎" + :numhl :GitSignsChangeNr + :linehl :GitSignsChangeLn} + :delete {:hl :GitSignsDelete + :text "契" + :numhl :GitSignsDeleteNr + :linehl :GitSignsDeleteLn} + :topdelete {:hl :GitSignsDelete + :text "契" + :numhl :GitSignsDeleteNr + :linehl :GitSignsDeleteLn} + :changedelete {:hl :GitSignsChange + :text "▎" + :numhl :GitSignsChangeNr + :linehl :GitSignsChangeLn}}) (let [gitsigns (util.load-plugin :gitsigns)] - (gitsigns.setup { - :signs signs - :signcolumn true - :numhl false - :linehl false - :word_diff false - :watch_gitdir { - :interval 1000 - :follow_files true - } - :attach_to_untracked true - :current_line_blame false - :current_line_blame_opts { - :virt_text true - :virt_text_pos "eol" - :delay 1000 - :ignore_whitespace false - } - :current_line_blame_formatter_opts { - :relative_time false - } - :sign_priority 6 - :update_debounce 100 - :status_formatter nil - :max_file_length 40000 - :preview_config { - :border "single" - :style "minimal" - :relative "cursor" - :row 0 - :col 1 - } - :yadm { - :enable false}})) + (gitsigns.setup {: signs + :signcolumn true + :numhl false + :linehl false + :word_diff false + :watch_gitdir {:interval 1000 :follow_files true} + :attach_to_untracked true + :current_line_blame false + :current_line_blame_opts {:virt_text true + :virt_text_pos :eol + :delay 1000 + :ignore_whitespace false} + :current_line_blame_formatter_opts {:relative_time false} + :sign_priority 6 + :update_debounce 100 + :status_formatter nil + :max_file_length 40000 + :preview_config {:border :single + :style :minimal + :relative :cursor + :row 0 + :col 1} + :yadm {:enable false}})) diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl index 53ba9e9..f623c0f 100644 --- a/fnl/config/hop.fnl +++ b/fnl/config/hop.fnl @@ -1,10 +1,8 @@ ;; Hopping in text. -(module config.hop - {autoload {util util - nvim aniseed.nvim}}) +(module config.hop {autoload {util util nvim aniseed.nvim}}) (let [hop (util.load-plugin :hop)] (hop.setup {})) -(nvim.set_keymap "n" "s" ":HopChar2" { :silent true }) -(nvim.set_keymap "n" "S" ":HopWord" { :silent true }) +(nvim.set_keymap :n :s ":HopChar2" {:silent true}) +(nvim.set_keymap :n :S ":HopWord" {:silent true}) diff --git a/fnl/config/impatient.fnl b/fnl/config/impatient.fnl index fda96a4..ab37eb3 100644 --- a/fnl/config/impatient.fnl +++ b/fnl/config/impatient.fnl @@ -1,6 +1,5 @@ ;; Speeds up loading of plugins. -(module config.impatient - {autoload {util util}}) +(module config.impatient {autoload {util util}}) (let [impatient (util.load-plugin :impatient)] (impatient.enable_profile)) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index d1a2ef8..b736f7a 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -1,26 +1,22 @@ ;; Load all plugin configs. -(module config.init - {require - {_ config.packer - _ config.alpha - ;;_ config.autocmd - _ config.autopairs - _ config.better-escape - _ config.bufferline - _ config.cmp - _ config.colorizer - _ config.colorscheme - _ config.gitsigns - _ config.lualine - _ config.ncomment - _ config.nvim-tree - _ config.orgmode - _ config.project - _ config.spectre - _ config.telescope - _ config.treesitter - _ config.which-key - _ config.zen - _ config.lsp - }}) - +(module config.init {require {_ config.packer + _ config.alpha + ;;_ config.autocmd + _ config.autopairs + _ config.better-escape + _ config.bufferline + _ config.cmp + _ config.colorizer + _ config.colorscheme + _ config.gitsigns + _ config.lualine + _ config.ncomment + _ config.nvim-tree + _ config.orgmode + _ config.project + _ config.spectre + _ config.telescope + _ config.treesitter + _ config.which-key + _ config.zen + _ config.lsp}}) diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index 950f3fb..1e3785b 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -1,60 +1,61 @@ -(module config.lsp.handlers - {autoload {util util - nvim aniseed.nvim}}) - -(def- signs - [{ :name "DiagnosticSignError" :text "" } - { :name "DiagnosticSignWarn" :text "" } - { :name "DiagnosticSignHint" :text "" } - { :name "DiagnosticSignInfo" :text "" }]) - -(defn- apply-signs [] - (each [_ sign (ipairs signs)] - (vim.fn.sign_define sign.name { :texthl sign.name :text sign.text :numhl "" }))) - -(def- config - {:virtual_text false - :signs { - :active signs - } - :update_in_insert true - :underline true - :severity_sort true - :float { - :focusable false - :style "minimal" - :border "rounded" - :source "always" - :header "" - :prefix ""}}) - -(defn setup [] - (apply-signs) - (vim.diagnostic.config config) - (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) - (set vim.lsp.handlers.textDocument/signatureHelp - (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} ))) - -(defn- lsp-keymaps [bufnr] - (let [opts { :noremap true :silent true }] - (nvim.buf_set_keymap bufnr :n :gD "lua vim.lsp.buf.declaration()" opts) - (nvim.buf_set_keymap bufnr :n :gd "lua vim.lsp.buf.definition()" opts) - (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" opts) - (nvim.buf_set_keymap bufnr :n :gI "lua vim.lsp.buf.implementation()" opts) - (nvim.buf_set_keymap bufnr :n :gr "lua vim.lsp.buf.references()" opts) - (nvim.buf_set_keymap bufnr :n :gl "lua vim.diagnostic.open_float()" opts) - (nvim.buf_set_keymap bufnr :n :q "lua vim.diagnostic.setloclist()" opts))) - -(defn on-attach [client bufnr] - (if (= client.name :html) - (set client.resolved_capabilities.document_formatting false)) - (lsp-keymaps bufnr)) - -(defn capabilities [] - (let [capabilities (vim.lsp.protocol.make_client_capabilities)] - (set capabilities.textDocument.completion.completionItem.snippetSupport true) - (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] - (cmp-nvim-lsp.update_capabilities capabilities)) - capabilities)) +(module config.lsp.handlers {autoload {util util nvim aniseed.nvim}}) + +(def- signs [{:name :DiagnosticSignError :text ""} + {:name :DiagnosticSignWarn :text ""} + {:name :DiagnosticSignHint :text ""} + {:name :DiagnosticSignInfo :text ""}]) + +(defn- apply-signs [] (each [_ sign (ipairs signs)] + (vim.fn.sign_define sign.name + {:texthl sign.name + :text sign.text + :numhl ""}))) + +(def- config {:virtual_text false + :signs {:active signs} + :update_in_insert true + :underline true + :severity_sort true + :float {:focusable false + :style :minimal + :border :rounded + :source :always + :header "" + :prefix ""}}) + +(defn setup [] (apply-signs) (vim.diagnostic.config config) + (set vim.lsp.handlers.textDocument/hover + (vim.lsp.with {:border :rounded})) + (set vim.lsp.handlers.textDocument/signatureHelp + (vim.lsp.with vim.lsp.handlers.signature_help {:border :rounded}))) + +(defn- lsp-keymaps [bufnr] + (let [opts {:noremap true :silent true}] + (nvim.buf_set_keymap bufnr :n :gD + "lua vim.lsp.buf.declaration()" opts) + (nvim.buf_set_keymap bufnr :n :gd + "lua vim.lsp.buf.definition()" opts) + (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" + opts) + (nvim.buf_set_keymap bufnr :n :gI + "lua vim.lsp.buf.implementation()" opts) + (nvim.buf_set_keymap bufnr :n :gr + "lua vim.lsp.buf.references()" opts) + (nvim.buf_set_keymap bufnr :n :gl + "lua vim.diagnostic.open_float()" opts) + (nvim.buf_set_keymap bufnr :n :q + "lua vim.diagnostic.setloclist()" opts))) + +(defn on-attach [client bufnr] (if (= client.name :html) + (set client.resolved_capabilities.document_formatting + false)) + (lsp-keymaps bufnr)) + +(defn capabilities [] (let [capabilities (vim.lsp.protocol.make_client_capabilities)] + (set capabilities.textDocument.completion.completionItem.snippetSupport + true) + (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] + (cmp-nvim-lsp.update_capabilities capabilities)) + capabilities)) (setup) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl index b26dd7a..c4a461d 100644 --- a/fnl/config/lsp/init.fnl +++ b/fnl/config/lsp/init.fnl @@ -1,8 +1,7 @@ ;; Loads the LSP module. -(module config.lsp.init - {autoload {util util}}) +(module config.lsp.init {autoload {util util}}) (let [_ (util.load-plugin :lspconfig)] - (require :config.lsp.lsp-installer) - (require :config.lsp.handlers) - (require :config.lsp.null-ls)) + (require :config.lsp.lsp-installer) + (require :config.lsp.handlers) + (require :config.lsp.null-ls)) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index 3649566..9522ef1 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -1,26 +1,22 @@ ;; LSP installer. -(module config.lsp.lsp-installer - {autoload {util util}}) +(module config.lsp.lsp-installer {autoload {util util}}) -(def- opts - (let [handlers (require :config.lsp.handlers)] - {:on_attach: handlers.on_attach - :capabilities handlers.capabilities})) +(def- opts (let [handlers (require :config.lsp.handlers)] + {"on_attach:" handlers.on_attach + :capabilities handlers.capabilities})) (defn- get-server-opts [server] - (when (= server.name :jsonls) - (let [jsonls-opts (require :config.lsp.settings.jsonls)] - (vim.tbl_deep_extend :force jsonls-opts opts))) - (when (= server.name :sumneko_lua) - (let [sumneko-lua-opts (require :config.lsp.settings.sumneko-lua)] - (vim.tbl_deep_extend :force sumneko-lua-opts.settings opts))) - (when (= server.name :pyright) - (let [pyright-opts (require :config.lsp.settings.pyright)] - (vim.tbl_deep_extend :force pyright-opts.settings opts))) - opts) - + (when (= server.name :jsonls) + (let [jsonls-opts (require :config.lsp.settings.jsonls)] + (vim.tbl_deep_extend :force jsonls-opts opts))) + (when (= server.name :sumneko_lua) + (let [sumneko-lua-opts (require :config.lsp.settings.sumneko-lua)] + (vim.tbl_deep_extend :force sumneko-lua-opts.settings opts))) + (when (= server.name :pyright) + (let [pyright-opts (require :config.lsp.settings.pyright)] + (vim.tbl_deep_extend :force pyright-opts.settings opts))) opts) (let [lsp-installer (util.load-plugin :nvim-lsp-installer)] (lsp-installer.on_server_ready (fn [server] - (let [opts (get-server-opts server)] - (server:setup opts))))) + (let [opts (get-server-opts server)] + (server:setup opts))))) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index c5b4aef..f046ee8 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -1,29 +1,26 @@ ;; Adds LSP diagnostics and formatting. -(module config.lsp.null-ls - {autoload {util util}}) +(module config.lsp.null-ls {autoload {util util}}) (let [null-ls (util.load-plugin :null-ls)] - (let [formatting null_ls.builtins.formatting + (let [formatting null_ls.builtins.formatting diagnostics null_ls.builtins.diagnostics] - (null-ls.setup - {:debug false - :sources [ - diagnostics.flake8 - diagnostics.golangci_lint - diagnostics.jsonlint - diagnostics.shellcheck - diagnostics.yamllint - (formatting.black.with { :extra_args [ "--fast" ] }) - formatting.erlfmt - formatting.fourmolu - formatting.gofmt - formatting.goimports - formatting.nixfmt - (formatting.prettier.with { - :extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] - }) - formatting.rustfmt - formatting.shfmt - formatting.sqlformat - formatting.stylua - formatting.terraform_fmt]}))) + (null-ls.setup {:debug false + :sources [diagnostics.flake8 + diagnostics.golangci_lint + diagnostics.jsonlint + diagnostics.shellcheck + diagnostics.yamllint + (formatting.black.with {:extra_args [:--fast]}) + formatting.erlfmt + formatting.fourmolu + formatting.gofmt + formatting.goimports + formatting.nixfmt + (formatting.prettier.with {:extra_args [:--no-semi + :--single-quote + :--jsx-single-quote]}) + formatting.rustfmt + formatting.shfmt + formatting.sqlformat + formatting.stylua + formatting.terraform_fmt]}))) diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl index c1cb710..73e8975 100644 --- a/fnl/config/lsp/settings/jsonls.fnl +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -1,16 +1,12 @@ ;; Json schema store catalog language server. -(module config.lsp.settings.jsonls - {autoload {util util}}) +(module config.lsp.settings.jsonls {autoload {util util}}) (let [schemastore (util.load-plugin :schemastore)] - (schemastore.setup - {:init_options { - :providerFormatter false} - :settings { - :json { - :schemas (schemastore.json.schemas)}} - :setup { - :commands { - :Format [ - (fn [] - (vim.lsp.buf.range_formatting [] [ 0 0 ] [ (vim.fn.line "$" 0) ]))]}}})) + (schemastore.setup {:init_options {:providerFormatter false} + :settings {:json {:schemas (schemastore.json.schemas)}} + :setup {:commands {:Format [(fn [] + (vim.lsp.buf.range_formatting [] + [0 + 0] + [(vim.fn.line "$" + 0)]))]}}})) diff --git a/fnl/config/lsp/settings/pyright.fnl b/fnl/config/lsp/settings/pyright.fnl index bb39ab5..7269469 100644 --- a/fnl/config/lsp/settings/pyright.fnl +++ b/fnl/config/lsp/settings/pyright.fnl @@ -1,8 +1,4 @@ ;; Config for pyright language server. (module config.lsp.settings.pyright) -(def settings - {:settings - {:python - {:analysis - {:typeCheckingMode "off"}}}}) +(def settings {:settings {:python {:analysis {:typeCheckingMode :off}}}}) diff --git a/fnl/config/lsp/settings/sumneko-lua.fnl b/fnl/config/lsp/settings/sumneko-lua.fnl index e39c801..cc8e9ab 100644 --- a/fnl/config/lsp/settings/sumneko-lua.fnl +++ b/fnl/config/lsp/settings/sumneko-lua.fnl @@ -1,19 +1,23 @@ ;; Config for a Lua language server. (module config.lsp.settings.sumneko-lua) -(def- workspace - {:library {(vim.fn.expand "$VIMRUNTIME/lua") true - (vim.fn.expand "$VIMRUNTIME/lua/vim/lsp") true}}) +(def- workspace + {:library {(vim.fn.expand :$VIMRUNTIME/lua) true + (vim.fn.expand :$VIMRUNTIME/lua/vim/lsp) true}}) -(def- diagnostics - {:globals ["vim" "map" "filter" "range" "reduce" "head" "tail" "nth" "use" "describe" "it" "dump"]}) +(def- diagnostics {:globals [:vim + :map + :filter + :range + :reduce + :head + :tail + :nth + :use + :describe + :it + :dump]}) -(def- runtime - {:version "LuaJIT" - :path (vim.split package.path ";")}) +(def- runtime {:version :LuaJIT :path (vim.split package.path ";")}) -(def settings - {:settings { - :Lua { - :diagnostics diagnostics - :workspace workspace}}}) +(def settings {:settings {:Lua {: diagnostics : workspace}}}) diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index 68f2f4f..5ab0920 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -1,60 +1,48 @@ ;; Statusbar. -(module config.lualine - {autoload {util util}}) +(module config.lualine {autoload {util util}}) -(defn- hide-in-width [] - (> (vim.fn.winwidth 0) 80)) +(defn- hide-in-width [] (> (vim.fn.winwidth 0) 80)) -(def- diagnostics { - 1 "diagnostics" - :sources [ "nvim_diagnostic" ] - :sections [ "error" "warn" ] - :symbols { :error " " :warn " " } - :colored false - :update_in_insert false - :always_visible true}) +(def- diagnostics {1 :diagnostics + :sources [:nvim_diagnostic] + :sections [:error :warn] + :symbols {:error " " :warn " "} + :colored false + :update_in_insert false + :always_visible true}) -(def- diff { - 1 "diff" - :colored false - :symbols { :added " " :modified " " :removed " " } - :cond hide-in-width}) +(def- diff {1 :diff + :colored false + :symbols {:added " " :modified " " :removed " "} + :cond hide-in-width}) -(def- branch { - 1 "b:gitsigns_head" - :icon " " - :cond hide-in-width}) +(def- branch {1 "b:gitsigns_head" :icon " " :cond hide-in-width}) -(def- filetype { - 1 "filetype" - :cond hide_in_width - :color {}}) +(def- filetype {1 :filetype :cond hide_in_width :color {}}) (let [lualine (util.load-plugin :lualine)] - (lualine.setup { - :options { - :icons_enabled true - :theme "auto" - :component_separators { :left "" :right "" } - :section_separators { :left "" :right "" } - :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ] - :always_divide_middle true - } - :sections { - :lualine_a [ "mode" ] - :lualine_b [ branch "filename" ] - :lualine_c [ diff ] - :lualine_x [ diagnostics filetype ] - :lualine_y {} - :lualine_z [ "location" "progress" "encoding" ] - } - :inactive_sections { - :lualine_a [ "mode" ] - :lualine_b [ "filename" ] - :lualine_c {} - :lualine_x {} - :lualine_y {} - :lualine_z [ "location" "progress" "encoding" ] - } - :tabline {} - :extensions {}})) + (lualine.setup {:options {:icons_enabled true + :theme :auto + :component_separators {:left "" :right ""} + :section_separators {:left "" :right ""} + :disabled_filetypes [:alpha + :dashboard + :NvimTree + :Outline] + :always_divide_middle true} + :sections {:lualine_a [:mode] + :lualine_b [branch :filename] + :lualine_c [diff] + :lualine_x [diagnostics filetype] + :lualine_y {} + :lualine_z [:location :progress :encoding]} + :inactive_sections {:lualine_a [:mode] + :lualine_b [:filename] + :lualine_c {} + :lualine_x {} + :lualine_y {} + :lualine_z [:location + :progress + :encoding]} + :tabline {} + :extensions {}})) diff --git a/fnl/config/ncomment.fnl b/fnl/config/ncomment.fnl index 2c983df..217ba6d 100644 --- a/fnl/config/ncomment.fnl +++ b/fnl/config/ncomment.fnl @@ -1,25 +1,23 @@ ;; Language aware commenting. -(module config.ncomment - {autoload {util util}}) +(module config.ncomment {autoload {util util}}) +(defn- get-type [ctx U] (or (and (= ctx.ctype U.ctype.line) :__default) + :__multiline)) -(defn- get-type [ctx U] - (or (and (= ctx.ctype U.ctype.line) :__default) :__multiline)) - -(defn- get-location [ctx U] - (if (= ctx.ctype U.ctype.block) - ((require :ts_context_commentstring.utils).get_cursor_location) - (or (= ctx.motion U.motion.v) (= ctx.motion U.cmotion.V)) - ((require :ts_context_commentstring.utils).get_visual_start_location) - nil)) +(defn- get-location [ctx U] (if (= ctx.ctype U.ctype.block) + ((require :ts_context_commentstring.utils) .get_cursor_location) + (or (= ctx.motion U.motion.v) + (= ctx.motion U.cmotion.V)) + ((require :ts_context_commentstring.utils) .get_visual_start_location) + nil)) (defn- pre-hook [ctx] - (let [U (require :Comment.utils)] - ((require :ts_context_commentstring.internal).calculate_commentstring { - :key (get-type ctx U) - :location (get-location ctx U)}))) + (let [U (require :Comment.utils)] + ((require :ts_context_commentstring.internal) .calculate_commentstring + {:key (get-type ctx U) + :location (get-location ctx + U)}))) (let [ncomment (util.load-plugin :Comment)] - (ncomment.setup - {:pre_hook (fn [ctx] - (pre-hook ctx))})) + (ncomment.setup {:pre_hook (fn [ctx] + (pre-hook ctx))})) diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl index eb579f7..672e370 100644 --- a/fnl/config/nvim-tree.fnl +++ b/fnl/config/nvim-tree.fnl @@ -1,105 +1,82 @@ ;; A file explorer. -(module config.nvim-tree - {autoload {util util - nvim aniseed.nvim}}) +(module config.nvim-tree {autoload {util util nvim aniseed.nvim}}) -(set nvim.g.nvim_tree_show_icons - {:default "" - :symlink "" - :git { - :unstaged "" - :staged "S" - :unmerged "" - :renamed "➜" - :deleted "" - :untracked "U" - :ignored "◌" - } - :folder { - :default "" - :open "" - :empty "" - :empty_open "" - :symlink ""}}) +(set nvim.g.nvim_tree_show_icons + {:default "" + :symlink "" + :git {:unstaged "" + :staged :S + :unmerged "" + :renamed "➜" + :deleted "" + :untracked :U + :ignored "◌"} + :folder {:default "" + :open "" + :empty "" + :empty_open "" + :symlink ""}}) (let [nvim-tree (util.load-plugin :nvim-tree) nvim-tree-config (util.load-plugin :nvim-tree.config)] (let [tree-cb nvim-tree-config.nvim_tree_callback] - (nvim-tree.setup - {:auto_reload_on_write true - :disable_netrw false - :hide_root_folder false - :hijack_cursor false - :hijack_netrw true - :hijack_unnamed_buffer_when_opening false - :ignore_buffer_on_setup false - :open_on_setup false - :open_on_tab false - :sort_by "name" - :update_cwd true - :view { - :width 30 - :height 30 - :side "left" - :preserve_window_proportions false - :number false - :relativenumber false - :signcolumn "yes" - :mappings { - :custom_only false - :list [ - { :key [ "l" "" "o" ] :cb (tree_cb "edit") } - { :key "h" :cb (tree_cb "close_node") } - { :key "v" :cb (tree_cb "vsplit") }]}} - :hijack_directories { - :enable true - :auto_open true} - :update_focused_file { - :enable true - :update_cwd true - :ignore_list {}} - :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ] - :system_open { - :cmd nil - :args {}} - :diagnostics { - :enable true - :show_on_dirs false - :icons { - :hint "" - :info "" - :warning "" - :error ""}} - :filters { - :dotfiles false - :custom {} - :exclude {}} - :git { - :enable true - :ignore true - :timeout 400} - :actions { - :change_dir { - :enable true - :global false} - :open_file { - :quit_on_open false - :resize_window false - :window_picker { - :enable true - :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" - :exclude { - :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ] - :buftype [ "nofile" "terminal" "help" ]}}}} - :trash { - :cmd "trash" - :require_confirm true} - :log { - :enable false - :truncate false - :types { - :all false - :config false - :copy_paste false - :git false - :profile false}}}))) + (nvim-tree.setup {:auto_reload_on_write true + :disable_netrw false + :hide_root_folder false + :hijack_cursor false + :hijack_netrw true + :hijack_unnamed_buffer_when_opening false + :ignore_buffer_on_setup false + :open_on_setup false + :open_on_tab false + :sort_by :name + :update_cwd true + :view {:width 30 + :height 30 + :side :left + :preserve_window_proportions false + :number false + :relativenumber false + :signcolumn :yes + :mappings {:custom_only false + :list [{:key [:l : :o] + :cb (tree_cb :edit)} + {:key :h + :cb (tree_cb :close_node)} + {:key :v :cb (tree_cb :vsplit)}]}} + :hijack_directories {:enable true :auto_open true} + :update_focused_file {:enable true + :update_cwd true + :ignore_list {}} + :ignore_ft_on_setup [:startify :dashboard :alpha] + :system_open {:cmd nil :args {}} + :diagnostics {:enable true + :show_on_dirs false + :icons {:hint "" + :info "" + :warning "" + :error ""}} + :filters {:dotfiles false :custom {} :exclude {}} + :git {:enable true :ignore true :timeout 400} + :actions {:change_dir {:enable true :global false} + :open_file {:quit_on_open false + :resize_window false + :window_picker {:enable true + :chars :ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 + :exclude {:filetype [:notify + :packer + :qf + :diff + :fugitive + :fugitiveblame] + :buftype [:nofile + :terminal + :help]}}}} + :trash {:cmd :trash :require_confirm true} + :log {:enable false + :truncate false + :types {:all false + :config false + :copy_paste false + :git false + :profile false}}}))) diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl index d8af6d4..e55f2bc 100644 --- a/fnl/config/orgmode.fnl +++ b/fnl/config/orgmode.fnl @@ -1,16 +1,17 @@ ;; Orgmode for nvim. -(module config.orgmode - {autoload {util util}}) +(module config.orgmode {autoload {util util}}) (let [orgmode (util.load-plugin :orgmode)] (do (orgmode.setup_ts_grammar) - (orgmode.setup - {:org_agenda_files [ "~/.local/share/org/**/*" ] - :org_default_notes_file "~/.local/share/org/refile.org" - :org_agenda_templates { - :t { :description "Task" :template "* TODO %?\n %u" } - :m { - :description "Meeting" - :template "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:"} - :n { :description "Note" :template "* NOTE %? :NOTE:\n %u" }}}))) + (orgmode.setup {:org_agenda_files ["~/.local/share/org/**/*"] + :org_default_notes_file "~/.local/share/org/refile.org" + :org_agenda_templates {:t {:description :Task + :template "* TODO %?\n %u"} + :m {:description :Meeting + :template "* MEETING %? :MEETING: + :LOGBOOK: + CLOCK: %U + :END:"} + :n {:description :Note + :template "* NOTE %? :NOTE:\n %u"}}}))) diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl index 0c5611b..8354c07 100644 --- a/fnl/config/packer.fnl +++ b/fnl/config/packer.fnl @@ -1,9 +1,7 @@ ;; Load packer config -(module config.packer - {autoload {util util}}) +(module config.packer {autoload {util util}}) (let [packer (util.load-plugin :packer)] - (packer.init { - :display { - :open_fn (fn [] - ((require :packer.util).float {:border :rounded}))}})) + (packer.init {:display {:open_fn (fn [] + ((require :packer.util) .float + {:border :rounded}))}})) diff --git a/fnl/config/project.fnl b/fnl/config/project.fnl index e2e6371..7d50fee 100644 --- a/fnl/config/project.fnl +++ b/fnl/config/project.fnl @@ -1,15 +1,19 @@ ;; Provides project management. -(module config.project - {autoload {util util}}) +(module config.project {autoload {util util}}) (let [project (util.load-plugin :project_nvim)] - (project.setup - {:active true - :on_config_done nil - :manual_mode false - :detection_methods [ :patterns ] - :patterns [ :git :_darcs :.hg :.bzr :.svn :Makefile :package.json ] - :show_hidden false - :silent_chdir true - :ignore_lsp {} - :datapath (vim.fn.stdpath :data)})) + (project.setup {:active true + :on_config_done nil + :manual_mode false + :detection_methods [:patterns] + :patterns [:git + :_darcs + :.hg + :.bzr + :.svn + :Makefile + :package.json] + :show_hidden false + :silent_chdir true + :ignore_lsp {} + :datapath (vim.fn.stdpath :data)})) diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl index 3a05c0b..5529714 100644 --- a/fnl/config/spectre.fnl +++ b/fnl/config/spectre.fnl @@ -1,99 +1,64 @@ ;; Find and replace. -(module config.spectre - {autoload {util util}}) +(module config.spectre {autoload {util util}}) (let [spectre (util.load-plugin :spectre)] - (spectre.setup - {:color_devicons true - :highlight { - :ui "String" - :search "DiffChange" - :replace "DiffDelete"} - :mapping { - :toggle_line { - :map "t" - :cmd "lua require('spectre').toggle_line()" - :desc "toggle current item"} - :enter_file { - :map "" - :cmd "lua require('spectre.actions').select_entry()" - :desc "goto current file"} - :send_to_qf { - :map "Q" - :cmd "lua require('spectre.actions').send_to_qf()" - :desc "send all item to quickfix"} - :replace_cmd { - :map "c" - :cmd "lua require('spectre.actions').replace_cmd()" - :desc "input replace vim command"} - :show_option_menu { - :map "o" - :cmd "lua require('spectre').show_options()" - :desc "show option"} - :run_replace { - :map "R" - :cmd "lua require('spectre.actions').run_replace()" - :desc "replace all"} - :change_view_mode { - :map "m" - :cmd "lua require('spectre').change_view()" - :desc "change result view mode"} - :toggle_ignore_case { - :map "I" - :cmd "lua require('spectre').change_options('ignore-case')" - :desc "toggle ignore case"} - :toggle_ignore_hidden { - :map "H" - :cmd "lua require('spectre').change_options('hidden')" - :desc "toggle search hidden"}} - :find_engine { - :rg { - :cmd "rg" - :args [ - "--color=never" - "--no-heading" - "--with-filename" - "--line-number" - "--column"] - :options { - :ignore-case { - :value "--ignore-case" - :icon "[I]" - :desc "ignore case"} - :hidden { - :value "--hidden" - :desc "hidden file" - :icon "[H]"}}} - :ag { - :cmd "ag" - :args [ - "--vimgrep" - "-s" - ] - :options { - :ignore-case { - :value "-i" - :icon "[I]" - :desc "ignore case"} - :hidden { - :value "--hidden" - :desc "hidden file" - :icon "[H]"}}}} - :replace_engine { - :sed { - :cmd "sed" - :args nil} - :options { - :ignore-case { - :value "--ignore-case" - :icon "[I]" - :desc "ignore case"}}} - :default { - :find { - :cmd "rg" - :options [ "ignore-case" ]} - :replace { - :cmd "sed"}} - :replace_vim_cmd "cdo" - :is_open_target_win true - :is_insert_mode false})) + (spectre.setup {:color_devicons true + :highlight {:ui :String + :search :DiffChange + :replace :DiffDelete} + :mapping {:toggle_line {:map :t + :cmd "lua require('spectre').toggle_line()" + :desc "toggle current item"} + :enter_file {:map : + :cmd "lua require('spectre.actions').select_entry()" + :desc "goto current file"} + :send_to_qf {:map :Q + :cmd "lua require('spectre.actions').send_to_qf()" + :desc "send all item to quickfix"} + :replace_cmd {:map :c + :cmd "lua require('spectre.actions').replace_cmd()" + :desc "input replace vim command"} + :show_option_menu {:map :o + :cmd "lua require('spectre').show_options()" + :desc "show option"} + :run_replace {:map :R + :cmd "lua require('spectre.actions').run_replace()" + :desc "replace all"} + :change_view_mode {:map :m + :cmd "lua require('spectre').change_view()" + :desc "change result view mode"} + :toggle_ignore_case {:map :I + :cmd "lua require('spectre').change_options('ignore-case')" + :desc "toggle ignore case"} + :toggle_ignore_hidden {:map :H + :cmd "lua require('spectre').change_options('hidden')" + :desc "toggle search hidden"}} + :find_engine {:rg {:cmd :rg + :args [:--color=never + :--no-heading + :--with-filename + :--line-number + :--column] + :options {:ignore-case {:value :--ignore-case + :icon "[I]" + :desc "ignore case"} + :hidden {:value :--hidden + :desc "hidden file" + :icon "[H]"}}} + :ag {:cmd :ag + :args [:--vimgrep :-s] + :options {:ignore-case {:value :-i + :icon "[I]" + :desc "ignore case"} + :hidden {:value :--hidden + :desc "hidden file" + :icon "[H]"}}}} + :replace_engine {:sed {:cmd :sed :args nil} + :options {:ignore-case {:value :--ignore-case + :icon "[I]" + :desc "ignore case"}}} + :default {:find {:cmd :rg :options [:ignore-case]} + :replace {:cmd :sed}} + :replace_vim_cmd :cdo + :is_open_target_win true + :is_insert_mode false})) diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl index 86f5f5c..90a6f71 100644 --- a/fnl/config/telescope.fnl +++ b/fnl/config/telescope.fnl @@ -1,98 +1,83 @@ ;; Telescope a highly extendable fuzzy finder over lists. -(module config.telescope - {autoload {util util}}) +(module config.telescope {autoload {util util}}) (let [telescope (util.load-plugin :telescope)] (let [actions (require :telescope.actions)] - (telescope.setup { - :defaults { - :prompt_prefix " " - :selection_caret " " - :path_display [ "smart" ] - :initial_mode "insert" - :selection_strategy "reset" - :sorting_strategy "ascending" - :layout_strategy "horizontal" - :layout_config { - :prompt_position "top" - :preview_cutoff 120 - :horizontal { :mirror false } - :vertical { :mirror false }} - :vimgrep_arguments [ - "rg" - "--color=never" - "--no-heading" - "--with-filename" - "--line-number" - "--column" - "--smart-case" - "--hidden" - ] - :mappings { - :i { - : actions.cycle_history_next - : actions.cycle_history_prev - - : actions.move_selection_next - : actions.move_selection_previous - - : actions.close - - : actions.move_selection_next - : actions.move_selection_previous - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab - - : actions.preview_scrolling_up - : actions.preview_scrolling_down - - : actions.results_scrolling_up - : actions.results_scrolling_down - - : (+ actions.toggle_selection actions.move_selection_worse) - : (+ actions.toggle_selection actions.move_selection_better) - : (+ actions.send_to_qflist actions.open_qflist) - : (+ actions.send_selected_to_qflist actions.open_qflist) - : actions.complete_tag - : actions.which_key} - :n { - : actions.close - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab - - : (+ actions.toggle_selection actions.move_selection_worse) - : (+ actions.toggle_selection actions.move_selection_better) - : (+ actions.send_to_qflist actions.open_qflist) - : (+ actions.send_selected_to_qflist actions.open_qflist) - - :j actions.move_selection_next - :k actions.move_selection_previous - :H actions.move_to_top - :M actions.move_to_middle - :L actions.move_to_bottom - - : actions.move_selection_next - : actions.move_selection_previous - :gg actions.move_to_top - :G actions.move_to_bottom - - : actions.preview_scrolling_up - : actions.preview_scrolling_down - - : actions.results_scrolling_up - : actions.results_scrolling_down - - :? actions.which_key}}} - :extensions { - :fzf { - :fuzzy true - :override_generic_sorter true - :override_file_sorter true - :case_mode "smart_case"}}}) + (telescope.setup {:defaults {:prompt_prefix " " + :selection_caret " " + :path_display [:smart] + :initial_mode :insert + :selection_strategy :reset + :sorting_strategy :ascending + :layout_strategy :horizontal + :layout_config {:prompt_position :top + :preview_cutoff 120 + :horizontal {:mirror false} + :vertical {:mirror false}} + :vimgrep_arguments [:rg + :--color=never + :--no-heading + :--with-filename + :--line-number + :--column + :--smart-case + :--hidden] + :mappings {:i {: actions.cycle_history_next + : actions.cycle_history_prev + : actions.move_selection_next + : actions.move_selection_previous + : actions.close + : actions.move_selection_next + : actions.move_selection_previous + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab + : actions.preview_scrolling_up + : actions.preview_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down + : (+ actions.toggle_selection + actions.move_selection_worse) + : (+ actions.toggle_selection + actions.move_selection_better) + : (+ actions.send_to_qflist + actions.open_qflist) + : (+ actions.send_selected_to_qflist + actions.open_qflist) + : actions.complete_tag + : actions.which_key} + :n {: actions.close + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab + : (+ actions.toggle_selection + actions.move_selection_worse) + : (+ actions.toggle_selection + actions.move_selection_better) + : (+ actions.send_to_qflist + actions.open_qflist) + : (+ actions.send_selected_to_qflist + actions.open_qflist) + :j actions.move_selection_next + :k actions.move_selection_previous + :H actions.move_to_top + :M actions.move_to_middle + :L actions.move_to_bottom + : actions.move_selection_next + : actions.move_selection_previous + :gg actions.move_to_top + :G actions.move_to_bottom + : actions.preview_scrolling_up + : actions.preview_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down + :? actions.which_key}}} + :extensions {:fzf {:fuzzy true + :override_generic_sorter true + :override_file_sorter true + :case_mode :smart_case}}}) (telescope.load_extension :fzf) (telescope.load_extension :file_browser) (telescope.load_extension :projects))) diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index 357859f..a76ff32 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -1,20 +1,15 @@ ;; Treesitter is a tool for building syntax trees for source files. ;; In the neovim context it helps with better coloring. -(module config.treesitter - {autoload {util util}}) +(module config.treesitter {autoload {util util}}) (let [treesitter (util.load-plugin :nvim-treesitter.configs)] - (treesitter.setup - {:ensure_installed "all" - :sync_install false - :ignore_install [ "" ] - :autopairs { :enable true } - :highlight { - :enable true - :disable [ "org" ] - :additional_vim_regex_highlighting [ "org" ]}} - :context_commentstring { - :enable true - :enable_autocmd false} - :indent { :enable true :disable [ "yaml" "python" "css" ] } - :playground { :enable true })) + (treesitter.setup {:ensure_installed :all + :sync_install false + :ignore_install [""] + :autopairs {:enable true} + :highlight {:enable true + :disable [:org] + :additional_vim_regex_highlighting [:org]}} + :context_commentstring {:enable true :enable_autocmd false} + :indent {:enable true :disable [:yaml :python :css]} + :playground {:enable true})) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 8c01ae6..020acd3 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -1,173 +1,126 @@ ;; Which-key provides a pop-up meny for some key mappings. -(module config.which-key - {autoload {util util}}) +(module config.which-key {autoload {util util}}) -(def- setup { - :plugins { - :marks true - :registers true - :spelling { - :enabled true - :suggestions 20} - :presets { - :operators false - :motions false - :text_objects false - :windows true - :nav true - :z true - :g true}} - :icons { - :breadcrumb "»" - :separator "" - :group "+"} - :popup_mappings { - :scroll_down "" - :scroll_up ""} - :window { - :border "rounded" - :position "bottom" - :margin [ 1 0 1 0 ] - :padding [ 2 2 2 2 ] - :winblend 0} - :layout { - :height { :min 4 :max 25 } - :width { :min 20 :max 50 } - :spacing 3 - :align "left"} - :ignore_missing true - :hidden [ "" "" "" "" "call" "lua" "^:" "^ " ] - :show_help true - :triggers "auto" - :triggers_blacklist { - :i [ "j" "k" ] - :v [ "j" "k" ]}}) +(def- setup {:plugins {:marks true + :registers true + :spelling {:enabled true :suggestions 20} + :presets {:operators false + :motions false + :text_objects false + :windows true + :nav true + :z true + :g true}} + :icons {:breadcrumb "»" :separator "" :group "+"} + :popup_mappings {:scroll_down : :scroll_up :} + :window {:border :rounded + :position :bottom + :margin [1 0 1 0] + :padding [2 2 2 2] + :winblend 0} + :layout {:height {:min 4 :max 25} + :width {:min 20 :max 50} + :spacing 3 + :align :left} + :ignore_missing true + :hidden [: : : : :call :lua "^:" "^ "] + :show_help true + :triggers :auto + :triggers_blacklist {:i [:j :k] :v [:j :k]}}) -(def- opts { - :mode "n" - :prefix "" - :buffer nil - :silent true - :noremap true - :nowait true}) +(def- opts {:mode :n + :prefix : + :buffer nil + :silent true + :noremap true + :nowait true}) -(def- mappings { - :k [ "lua require('Comment.api').toggle_current_linewise()" "Comment" ] - :a [ "Alpha" "Alpha" ] - :b [ - "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer false})" - "Buffers" - ] - :e [ "NvimTreeToggle" "Explorer" ] - :c [ "Bdelete!" "Close Buffer" ] - :n [ "nohlsearch" "No Highlight" ] - :f [ - "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer false})" - "Find files" - ] - :F [ "Telescope file_browser" "Browse files" ] - :t [ "Telescope live_grep theme=ivy" "Find Text" ] - :P [ "Telescope projects" "Projects" ] - :z [ "ZenMode" "Zen Mode" ] - :v [ "vsplit" "Vertical Split" ] - :h [ "split" "Horizontal Split" ] - :p { - :name "Packer" - :c [ "PackerCompile" "Compile" ] - :i [ "PackerInstall" "Install" ] - :s [ "PackerSync" "Sync" ] - :S [ "PackerStatus" "Status" ] - :u [ "PackerUpdate" "Update" ]} - :g { - :name "Git" - :g [ "lua _LAZYGIT_TOGGLE()" "Lazygit" ] - :j [ "lua require 'gitsigns'.next_hunk()" "Next Hunk" ] - :k [ "lua require 'gitsigns'.prev_hunk()" "Prev Hunk" ] - :l [ "lua require 'gitsigns'.blame_line()" "Blame" ] - :p [ "lua require 'gitsigns'.preview_hunk()" "Preview Hunk" ] - :r [ "lua require 'gitsigns'.reset_hunk()" "Reset Hunk" ] - :R [ "lua require 'gitsigns'.reset_buffer()" "Reset Buffer" ] - :s [ "lua require 'gitsigns'.stage_hunk()" "Stage Hunk" ] - :u [ - "lua require 'gitsigns'.undo_stage_hunk()" - "Undo Stage Hunk" - ] - :o [ "Telescope git_status" "Open changed file" ] - :b [ "Telescope git_branches" "Checkout branch" ] - :c [ "Telescope git_commits" "Checkout commit" ] - :d [ - "Gitsigns diffthis HEAD" - "Diff" - ]} - :l { - :name "LSP" - :a [ "lua vim.lsp.buf.code_action()" "Code Action" ] - :d [ - "Telescope lsp_document_diagnostics" - "Document Diagnostics" - ] - :w [ - "Telescope lsp_workspace_diagnostics" - "Workspace Diagnostics" - ] - :f [ "lua vim.lsp.buf.formatting()" "Format" ] - :i [ "LspInfo" "Info" ] - :I [ "LspInstallInfo" "Installer Info" ] - :j [ - "lua vim.lsp.diagnostic.goto_next()" - "Next Diagnostic" - ] - :k [ - "lua vim.lsp.diagnostic.goto_prev()" - "Prev Diagnostic" - ] - :l [ "lua vim.lsp.codelens.run()" "CodeLens Action" ] - :q [ "lua vim.lsp.diagnostic.set_loclist()" "Quickfix" ] - :r [ "lua vim.lsp.buf.rename()" "Rename" ] - :s [ "Telescope lsp_document_symbols" "Document Symbols" ] - :S [ - "Telescope lsp_dynamic_workspace_symbols" - "Workspace Symbols" - ]} - :s { - :name "Search" - :b [ "Telescope git_branches" "Checkout branch" ] - :c [ "Telescope colorscheme" "Colorscheme" ] - :h [ "Telescope help_tags" "Find Help" ] - :M [ "Telescope man_pages" "Man Pages" ] - :r [ "Telescope oldfiles" "Open Recent File" ] - :R [ "Telescope registers" "Registers" ] - :k [ "Telescope keymaps" "Keymaps" ] - :C [ "Telescope commands" "Commands" ]} - :o { - :name "Orgmode" - :a [ "lua require('orgmode').action('agenda.prompt')" "Open agenda prompt" ] - :c [ "lua require('orgmode').action('capture.prompt')" "Open capture prompt" ]} - :r { - :name "Replace" - :r [ "lua require('spectre').open()" "Replace" ] - :w [ - "lua require('spectre').open_visual({select_word=true})" - "Replace Word" - ] - :f [ "lua require('spectre').open_file_search()" "Replace Buffer" ] - } - :T { - :name "Treesitter" - :p [ "TSPlaygroundToggle" "Playground" ]}}) +(def- mappings + {:k ["lua require('Comment.api').toggle_current_linewise()" + :Comment] + :a [:Alpha :Alpha] + :b ["lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer false})" + :Buffers] + :e [:NvimTreeToggle :Explorer] + :c [:Bdelete! "Close Buffer"] + :n [:nohlsearch "No Highlight"] + :f ["lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer false})" + "Find files"] + :F ["Telescope file_browser" "Browse files"] + :t ["Telescope live_grep theme=ivy" "Find Text"] + :P ["Telescope projects" :Projects] + :z [:ZenMode "Zen Mode"] + :v [:vsplit "Vertical Split"] + :h [:split "Horizontal Split"] + :p {:name :Packer + :c [:PackerCompile :Compile] + :i [:PackerInstall :Install] + :s [:PackerSync :Sync] + :S [:PackerStatus :Status] + :u [:PackerUpdate :Update]} + :g {:name :Git + :g ["lua _LAZYGIT_TOGGLE()" :Lazygit] + :j ["lua require 'gitsigns'.next_hunk()" "Next Hunk"] + :k ["lua require 'gitsigns'.prev_hunk()" "Prev Hunk"] + :l ["lua require 'gitsigns'.blame_line()" :Blame] + :p ["lua require 'gitsigns'.preview_hunk()" "Preview Hunk"] + :r ["lua require 'gitsigns'.reset_hunk()" "Reset Hunk"] + :R ["lua require 'gitsigns'.reset_buffer()" "Reset Buffer"] + :s ["lua require 'gitsigns'.stage_hunk()" "Stage Hunk"] + :u ["lua require 'gitsigns'.undo_stage_hunk()" + "Undo Stage Hunk"] + :o ["Telescope git_status" "Open changed file"] + :b ["Telescope git_branches" "Checkout branch"] + :c ["Telescope git_commits" "Checkout commit"] + :d ["Gitsigns diffthis HEAD" :Diff]} + :l {:name :LSP + :a ["lua vim.lsp.buf.code_action()" "Code Action"] + :d ["Telescope lsp_document_diagnostics" + "Document Diagnostics"] + :w ["Telescope lsp_workspace_diagnostics" + "Workspace Diagnostics"] + :f ["lua vim.lsp.buf.formatting()" :Format] + :i [:LspInfo :Info] + :I [:LspInstallInfo "Installer Info"] + :j ["lua vim.lsp.diagnostic.goto_next()" "Next Diagnostic"] + :k ["lua vim.lsp.diagnostic.goto_prev()" "Prev Diagnostic"] + :l ["lua vim.lsp.codelens.run()" "CodeLens Action"] + :q ["lua vim.lsp.diagnostic.set_loclist()" :Quickfix] + :r ["lua vim.lsp.buf.rename()" :Rename] + :s ["Telescope lsp_document_symbols" "Document Symbols"] + :S ["Telescope lsp_dynamic_workspace_symbols" + "Workspace Symbols"]} + :s {:name :Search + :b ["Telescope git_branches" "Checkout branch"] + :c ["Telescope colorscheme" :Colorscheme] + :h ["Telescope help_tags" "Find Help"] + :M ["Telescope man_pages" "Man Pages"] + :r ["Telescope oldfiles" "Open Recent File"] + :R ["Telescope registers" :Registers] + :k ["Telescope keymaps" :Keymaps] + :C ["Telescope commands" :Commands]} + :o {:name :Orgmode + :a ["lua require('orgmode').action('agenda.prompt')" + "Open agenda prompt"] + :c ["lua require('orgmode').action('capture.prompt')" + "Open capture prompt"]} + :r {:name :Replace + :r ["lua require('spectre').open()" :Replace] + :w ["lua require('spectre').open_visual({select_word=true})" + "Replace Word"] + :f ["lua require('spectre').open_file_search()" + "Replace Buffer"]} + :T {:name :Treesitter :p [:TSPlaygroundToggle :Playground]}}) -(def- vopts { - :mode "v" - :prefix "" - :buffer nil - :silent true - :noremap true - :nowait true}) +(def- vopts {:mode :v + :prefix : + :buffer nil + :silent true + :noremap true + :nowait true}) -(def- vmappings { - :k [ - "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())" - "Comment" ]}) +(def- vmappings {:k ["lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())" + :Comment]}) (let [which-key (util.load-plugin :which-key)] (do diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl index e17d5d3..7133b50 100644 --- a/fnl/config/zen.fnl +++ b/fnl/config/zen.fnl @@ -1,18 +1,13 @@ ;; Zen mode. -(module config.zen - {autoload {util util}}) +(module config.zen {autoload {util util}}) (let [zen-mode (util.load-plugin :zen-mode)] - (zen-mode.setup - {:window { - :backdrop 1 - :height 1 - :width 120 - :options { - :signcolumn "no" - :number false - :relativenumber false}} - :plugins { - :gitsigns { :enabled false } - :tmux { :enabled true } - :twilight { :enabled true }}})) + (zen-mode.setup {:window {:backdrop 1 + :height 1 + :width 120 + :options {:signcolumn :no + :number false + :relativenumber false}} + :plugins {:gitsigns {:enabled false} + :tmux {:enabled true} + :twilight {:enabled true}}})) diff --git a/fnl/init.fnl b/fnl/init.fnl index bd91031..f62b1cf 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,5 +1,2 @@ ;; Install, load settings, and load plugin configs. -(module init - {require {_ settings - _ install - _ config}}) +(module init {require {_ settings _ install _ config}}) diff --git a/fnl/install.fnl b/fnl/install.fnl index d6eef2c..d80de8f 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -1,14 +1,9 @@ ;; Installs plugins with packer. -(module install - {autoload { - a aniseed.core - plugins plugins - packer packer}}) +(module install {autoload {a aniseed.core plugins plugins packer packer}}) (defn- install-plugins [plgs] - (packer.startup ( - fn [use] - (each [plugin opts (pairs plgs)] - (use (a.assoc opts 1 plugin)))))) + (packer.startup (fn [use] + (each [plugin opts (pairs plgs)] + (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 3994ba7..23bf9cb 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -1,64 +1,64 @@ ;; List of plugins (module plugins) -(def plugins - {:wbthomason/packer.nvim {} ;; Have packer manage itself - :lewis6991/impatient.nvim {} - :Olical/aniseed {} - - :nvim-lua/popup.nvim {} ;; An implementation of the Popup API from vim in Neovim - :nvim-lua/plenary.nvim {} ;; Useful lua functions used ny lots of plugins - - ;; Colorschemes - :aktersnurra/no-clown-fiesta.nvim {} - - ;; LSP - :hrsh7th/nvim-cmp {} ;; The completion plugin - :hrsh7th/cmp-buffer {} ;; buffer completions - :hrsh7th/cmp-path {} ;; path completions - :hrsh7th/cmp-cmdline {} ;; cmdline completions - :saadparwaiz1/cmp_luasnip {} ;; snippet completions - :onsails/lspkind-nvim {} - :hrsh7th/cmp-nvim-lsp {} - :neovim/nvim-lspconfig {} - :williamboman/nvim-lsp-installer {} - :tamago324/nlsp-settings.nvim {} - :jose-elias-alvarez/null-ls.nvim {} - :b0o/SchemaStore.nvim {} - - ;; Snippets - :L3MON4D3/LuaSnip {} - :rafamadriz/friendly-snippets {} - - ;; Telescope - :nvim-telescope/telescope.nvim { :requires "nvim-lua/plenary.nvim" } - :nvim-telescope/telescope-fzf-native.nvim { :run "make" } - :nvim-telescope/telescope-file-browser.nvim {} - - ;; Treesitter - :nvim-treesitter/nvim-treesitter { :run ":TSUpdate" } - :JoosepAlviste/nvim-ts-context-commentstring {} - :nvim-treesitter/playground {} - - ;; Miscellaneous plugins - :windwp/nvim-autopairs {} - :numToStr/Comment.nvim {} - :lewis6991/gitsigns.nvim {} - :kyazdani42/nvim-web-devicons {} - :kyazdani42/nvim-tree.lua {} - :akinsho/bufferline.nvim {} - :moll/vim-bbye {} - - :nvim-lualine/lualine.nvim { :requires { 1 "kyazdani42/nvim-web-devicons" :opt true }} - :ahmedkhalf/project.nvim {} - :goolord/alpha-nvim {} - :antoinemadec/FixCursorHold.nvim {} ;; This is needed to fix lsp doc highlight - :folke/which-key.nvim {} - :folke/zen-mode.nvim {} - :windwp/nvim-spectre {} - :phaazon/hop.nvim {} - - :kevinhwang91/nvim-bqf { :event "BufRead" } - :norcalli/nvim-colorizer.lua {} - :max397574/better-escape.nvim {} - :nvim-orgmode/orgmode {}}) +(def plugins {:wbthomason/packer.nvim {} + ;; Have packer manage itself + :lewis6991/impatient.nvim {} + :Olical/aniseed {} + :nvim-lua/popup.nvim {} + ;; An implementation of the Popup API from vim in Neovim + :nvim-lua/plenary.nvim {} + ;; Useful lua functions used ny lots of plugins + ;; Colorschemes + :aktersnurra/no-clown-fiesta.nvim {} + ;; LSP + :hrsh7th/nvim-cmp {} + ;; The completion plugin + :hrsh7th/cmp-buffer {} + ;; buffer completions + :hrsh7th/cmp-path {} + ;; path completions + :hrsh7th/cmp-cmdline {} + ;; cmdline completions + :saadparwaiz1/cmp_luasnip {} + ;; snippet completions + :onsails/lspkind-nvim {} + :hrsh7th/cmp-nvim-lsp {} + :neovim/nvim-lspconfig {} + :williamboman/nvim-lsp-installer {} + :tamago324/nlsp-settings.nvim {} + :jose-elias-alvarez/null-ls.nvim {} + :b0o/SchemaStore.nvim {} + ;; Snippets + :L3MON4D3/LuaSnip {} + :rafamadriz/friendly-snippets {} + ;; Telescope + :nvim-telescope/telescope.nvim {:requires :nvim-lua/plenary.nvim} + :nvim-telescope/telescope-fzf-native.nvim {:run :make} + :nvim-telescope/telescope-file-browser.nvim {} + ;; Treesitter + :nvim-treesitter/nvim-treesitter {:run ":TSUpdate"} + :JoosepAlviste/nvim-ts-context-commentstring {} + :nvim-treesitter/playground {} + ;; Miscellaneous plugins + :windwp/nvim-autopairs {} + :numToStr/Comment.nvim {} + :lewis6991/gitsigns.nvim {} + :kyazdani42/nvim-web-devicons {} + :kyazdani42/nvim-tree.lua {} + :akinsho/bufferline.nvim {} + :moll/vim-bbye {} + :nvim-lualine/lualine.nvim {:requires {1 :kyazdani42/nvim-web-devicons + :opt true}} + :ahmedkhalf/project.nvim {} + :goolord/alpha-nvim {} + :antoinemadec/FixCursorHold.nvim {} + ;; This is needed to fix lsp doc highlight + :folke/which-key.nvim {} + :folke/zen-mode.nvim {} + :windwp/nvim-spectre {} + :phaazon/hop.nvim {} + :kevinhwang91/nvim-bqf {:event :BufRead} + :norcalli/nvim-colorizer.lua {} + :max397574/better-escape.nvim {} + :nvim-orgmode/orgmode {}}) diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl index 5c21629..bff9c86 100644 --- a/fnl/settings/init.fnl +++ b/fnl/settings/init.fnl @@ -1,4 +1,2 @@ ;; Load nvim settings -(module settings - {require {_ settings.options - _ settings.keymaps}}) +(module settings {require {_ settings.options _ settings.keymaps}}) diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 1d431e5..52254cd 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -1,13 +1,11 @@ ;; Custom keymappings. -(module settings.keymaps - {autoload {nvim aniseed.nvim}}) +(module settings.keymaps {autoload {nvim aniseed.nvim}}) (def- opts {:noremap true :silent true}) -(defn- map [mode lhs rhs opt] - (nvim.set_keymap mode lhs rhs opt)) +(defn- map [mode lhs rhs opt] (nvim.set_keymap mode lhs rhs opt)) ;;Remap space as leader key -(map "" "" "" opts) +(map "" : : opts) (set nvim.g.mapleader " ") (set nvim.g.maplocalleader " ") @@ -21,35 +19,34 @@ ;; Normal ;; ;; Better window navigation -(map "n" "" "h" opts) -(map "n" "" "j" opts) -(map "n" "" "k" opts) -(map "n" "" "l" opts) - +(map :n : :h opts) +(map :n : :j opts) +(map :n : :k opts) +(map :n : :l opts) ;; Resize with arrows -(map "n" "" ":resize -2" opts) -(map "n" "" ":resize +2" opts) -(map "n" "" ":vertical resize -2" opts) -(map "n" "" ":vertical resize +2" opts) +(map :n : ":resize -2" opts) +(map :n : ":resize +2" opts) +(map :n : ":vertical resize -2" opts) +(map :n : ":vertical resize +2" opts) ;; Navigate buffers -(map "n" "" ":bnext" opts) -(map "n" "" ":bprevious" opts) +(map :n : ":bnext" opts) +(map :n : ":bprevious" opts) ;; Visual ;; ;; Stay in indent mode -(map "v" "<" "" ">gv" opts) +(map :v "<" :" :>gv opts) ;; Visual Block ;; ;; Move text up and down -(map "x" "J" ":move '>+1gv-gv" opts) -(map "x" "K" ":move '<-2gv-gv" opts) -(map "x" "" ":move '>+1gv-gv" opts) -(map "x" "" ":move '<-2gv-gv" opts) +(map :x :J ":move '>+1gv-gv" opts) +(map :x :K ":move '<-2gv-gv" opts) +(map :x : ":move '>+1gv-gv" opts) +(map :x : ":move '<-2gv-gv" opts) ;; Move text up and down -(map "v" "" ":m .+1==" opts) -(map "v" "" ":m .-2==" opts) -(map "v" "p" "\"_dP" opts) +(map :v : ":m .+1==" opts) +(map :v : ":m .-2==" opts) +(map :v :p "\"_dP" opts) diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 4e560ce..f49867e 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -1,51 +1,80 @@ ;; Sets options in neovim -(module settings.options - {autoload {nvim aniseed.nvim}}) +(module settings.options {autoload {nvim aniseed.nvim}}) -(def- opts { - :backup false ;; creates a backup file - :clipboard "unnamedplus" ;; allows neovim to access the system clipboard - :cmdheight 2 ;; more space in the neovim command line for displaying messages - :completeopt { "menuone" "noselect" } ;; mostly just for cmp - :conceallevel 0 ;; so that `` is visible in markdown files - :fileencoding "utf-8" ;; the encoding written to a file - :hlsearch true ;; highlight all matches on previous search pattern - :ignorecase true ;; ignore case in search patterns - :mouse "" ;; disable the mouse to be used in neovim - :pumheight 10 ;; pop up menu height - :showmode false ;; we don't need to see things like ;; INSERT ;; anymore - :showtabline 2 ;; always show tabs - :smartcase true ;; smart case - :smartindent true ;; make indenting smarter again - :splitbelow true ;; force all horizontal splits to go below current window - :splitright true ;; force all vertical splits to go to the right of current window - :swapfile false ;; creates a swapfile - :termguicolors true ;; set term gui colors (most terminals support this) - :timeoutlen 1000 ;; time to wait for a mapped sequence to complete (in milliseconds) - :undofile true ;; enable persistent undo - :updatetime 300 ;; faster completion (4000ms default) - :writebackup false ;; if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - :expandtab true ;; convert tabs to spaces - :shiftwidth 2 ;; the number of spaces inserted for each indentation - :tabstop 2 ;; insert 2 spaces for a tab - :cursorline true ;; highlight the current line - :number true ;; set numbered lines - :relativenumber true ;; set relative numbered lines - :numberwidth 4 ;; set number column width to 2 {default 4} - :signcolumn "yes" ;; always show the sign column, otherwise it would shift the text each time - :wrap false ;; display lines as one long line - :scrolloff 8 ;; is one of my fav - :sidescrolloff 8 - :guifont "monospace:h17" ;; the font used in graphical neovim applications - } -) +(def- opts {:backup false + ;; creates a backup file + :clipboard :unnamedplus + ;; allows neovim to access the system clipboard + :cmdheight 2 + ;; more space in the neovim command line for displaying messages + :completeopt {:menuone :noselect} + ;; mostly just for cmp + :conceallevel 0 + ;; so that `` is visible in markdown files + :fileencoding :utf-8 + ;; the encoding written to a file + :hlsearch true + ;; highlight all matches on previous search pattern + :ignorecase true + ;; ignore case in search patterns + :mouse "" + ;; disable the mouse to be used in neovim + :pumheight 10 + ;; pop up menu height + :showmode false + ;; we don't need to see things like ;; INSERT ;; anymore + :showtabline 2 + ;; always show tabs + :smartcase true + ;; smart case + :smartindent true + ;; make indenting smarter again + :splitbelow true + ;; force all horizontal splits to go below current window + :splitright true + ;; force all vertical splits to go to the right of current window + :swapfile false + ;; creates a swapfile + :termguicolors true + ;; set term gui colors (most terminals support this) + :timeoutlen 1000 + ;; time to wait for a mapped sequence to complete (in milliseconds) + :undofile true + ;; enable persistent undo + :updatetime 300 + ;; faster completion (4000ms default) + :writebackup false + ;; if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited + :expandtab true + ;; convert tabs to spaces + :shiftwidth 2 + ;; the number of spaces inserted for each indentation + :tabstop 2 + ;; insert 2 spaces for a tab + :cursorline true + ;; highlight the current line + :number true + ;; set numbered lines + :relativenumber true + ;; set relative numbered lines + :numberwidth 4 + ;; set number column width to 2 {default 4} + :signcolumn :yes + ;; always show the sign column, otherwise it would shift the text each time + :wrap false + ;; display lines as one long line + :scrolloff 8 + ;; is one of my fav + :sidescrolloff 8 + :guifont "monospace:h17" + ;; the font used in graphical neovim applications + }) -(defn- apply-opts [] - (each [k v (pairs opts)] - (tset vim.opt k v))) +(defn- apply-opts [] (each [k v (pairs opts)] + (tset vim.opt k v))) (apply-opts) (vim.cmd "set whichwrap+=<,>,[,],h,l") (vim.cmd "set iskeyword+=-") (vim.cmd "set formatoptions-=cro") -(nvim.ex.set "shortmess+=c") +(nvim.ex.set :shortmess+=c) diff --git a/fnl/util.fnl b/fnl/util.fnl index 18345ad..e6b4d9f 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -1,12 +1,11 @@ ;; Utility functions. -(module util - {autoload {nvim aniseed.nvim}}) +(module util {autoload {nvim aniseed.nvim}}) -(defn autocmd [name opts] - (nvim.ex.create_autocmd name opts)) +(defn autocmd [name opts] (nvim.ex.create_autocmd name opts)) (defn load-plugin [name] - (let [(ok? val-or-err) (pcall require name)] - (if ok? - val-or-err - (vim.notify (.. "Could not load config: " val-or-err) vim.log.levels.WARN)))) + (let [(ok? val-or-err) (pcall require name)] + (if ok? + val-or-err + (vim.notify (.. "Could not load config: " val-or-err) + vim.log.levels.WARN)))) -- cgit v1.2.3-70-g09d2 From 64e7da942c8e051ee52e8ecefd17cd8b89b90246 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:53:41 +0200 Subject: fix(bootstrap): mv loading of impatient --- bootstrap.lua | 3 --- fnl/config/init.fnl | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bootstrap.lua b/bootstrap.lua index ab84c17..6147c84 100644 --- a/bootstrap.lua +++ b/bootstrap.lua @@ -24,6 +24,3 @@ end ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") ensure("lewis6991", "impatient.nvim") - --- Enable faster loading with impatient -require "impatient" diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index b736f7a..975288b 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -1,5 +1,6 @@ ;; Load all plugin configs. -(module config.init {require {_ config.packer +(module config.init {require {_ config.impatient + _ config.packer _ config.alpha ;;_ config.autocmd _ config.autopairs -- cgit v1.2.3-70-g09d2 From caf3656d5bc4d9f832791b424f5001828eaf4c49 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:54:05 +0200 Subject: fix(bootstrap): remove lua impl --- bootstrap.lua | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 bootstrap.lua diff --git a/bootstrap.lua b/bootstrap.lua deleted file mode 100644 index 6147c84..0000000 --- a/bootstrap.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Bootstrap nvim with essential plugins. - -local fn = vim.fn -local fmt = string.format -local execute = vim.api.nvim_command - -local function ensure(user, repository) - local packer_path = fn.stdpath "data" .. "/site/pack" - local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) - if fn.empty(fn.glob(ensure_path)) > 0 then - execute( - fmt( - "!git clone --depth 1 https://github.com/%s/%s %s", - user, - repository, - ensure_path - ) - ) - execute(fmt("packadd %s", repository)) - end -end - --- Bootstrap install essential modules if not present -ensure("wbthomason", "packer.nvim") -ensure("Olical", "aniseed") -ensure("lewis6991", "impatient.nvim") -- cgit v1.2.3-70-g09d2 From c97475eeabc08df8aa5dfe6d476866217aaa55dc Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:54:16 +0200 Subject: fix(bootstrap): add fnl impl --- fnl/bootstrap.fnl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 fnl/bootstrap.fnl diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl new file mode 100644 index 0000000..8ee3e0f --- /dev/null +++ b/fnl/bootstrap.fnl @@ -0,0 +1,27 @@ +;; Bootstraping for fresh install +(module bootstrap {autoload {util util}}) + +(defn- fmt [s ...] (string.format s ...)) + +(def- packer-path (.. (vim.fn.stdpath :data) :site/pack)) + +(def- git-clone-url "!git clone --depth 1 https://github.com/%s/%s %s") + +(defn- execute [cmd] (vim.api.nvim_command cmd)) + +(defn- ensure-path [packer-path repository] + (fmt "%s/packer/start/%s" packer-path repository)) + +(defn- ensure [user repository] + (let [path (ensure-path packer-path repository)]) + (if (> (vim.fn.empty (vim.fn.glob path) 0)) + (do + (execute (fmt git-clone-url user repository path)) + (execute (fmt "packadd %s" repository)) + true) + false)) + +(defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] + (ensure :Olical :aniseed) + (ensure :lewis6991 :impatient.nvim) + is_bootstrapped)) -- cgit v1.2.3-70-g09d2 From 903b92b2528d23267036a78fa92efd7a389833c4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:55:34 +0200 Subject: fix(install): run bootstrap --- fnl/install.fnl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index d80de8f..9586948 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -1,9 +1,15 @@ ;; Installs plugins with packer. -(module install {autoload {a aniseed.core plugins plugins packer packer}}) +(module install {autoload {a aniseed.core + plugins plugins + packer packer + bootstrap bootstrap}}) (defn- install-plugins [plgs] (packer.startup (fn [use] (each [plugin opts (pairs plgs)] - (use (a.assoc opts 1 plugin)))))) + (use (a.assoc opts 1 plugin))))) + (if (= is_bootstrapped true) + ((require :config.packer) .sync))) +(local is_bootstrapped (bootstrap.run)) (install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From c2f6208139dc6fb8f76fff806e6808ff4cceb0a9 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:56:36 +0200 Subject: refactor(lsp installer): rename lsp settings --- fnl/config/lsp/lsp-installer.fnl | 8 ++++---- fnl/config/lsp/settings/pyright.fnl | 2 +- fnl/config/lsp/settings/sumneko-lua.fnl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index 9522ef1..72bef8e 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -10,11 +10,11 @@ (let [jsonls-opts (require :config.lsp.settings.jsonls)] (vim.tbl_deep_extend :force jsonls-opts opts))) (when (= server.name :sumneko_lua) - (let [sumneko-lua-opts (require :config.lsp.settings.sumneko-lua)] - (vim.tbl_deep_extend :force sumneko-lua-opts.settings opts))) + (let [sumneko-lua (require :config.lsp.settings.sumneko-lua)] + (vim.tbl_deep_extend :force sumneko-lua.opts opts))) (when (= server.name :pyright) - (let [pyright-opts (require :config.lsp.settings.pyright)] - (vim.tbl_deep_extend :force pyright-opts.settings opts))) opts) + (let [pyright (require :config.lsp.settings.pyright)] + (vim.tbl_deep_extend :force pyright.opts opts))) opts) (let [lsp-installer (util.load-plugin :nvim-lsp-installer)] (lsp-installer.on_server_ready (fn [server] diff --git a/fnl/config/lsp/settings/pyright.fnl b/fnl/config/lsp/settings/pyright.fnl index 7269469..639ecff 100644 --- a/fnl/config/lsp/settings/pyright.fnl +++ b/fnl/config/lsp/settings/pyright.fnl @@ -1,4 +1,4 @@ ;; Config for pyright language server. (module config.lsp.settings.pyright) -(def settings {:settings {:python {:analysis {:typeCheckingMode :off}}}}) +(def opts {:settings {:python {:analysis {:typeCheckingMode :off}}}}) diff --git a/fnl/config/lsp/settings/sumneko-lua.fnl b/fnl/config/lsp/settings/sumneko-lua.fnl index cc8e9ab..90c8807 100644 --- a/fnl/config/lsp/settings/sumneko-lua.fnl +++ b/fnl/config/lsp/settings/sumneko-lua.fnl @@ -20,4 +20,4 @@ (def- runtime {:version :LuaJIT :path (vim.split package.path ";")}) -(def settings {:settings {:Lua {: diagnostics : workspace}}}) +(def opts {:settings {:Lua {: diagnostics : workspace}}}) -- cgit v1.2.3-70-g09d2 From 420b7ff3373c4b60f47617d91b06022ae65107b9 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:56:51 +0200 Subject: style: format --- fnl/config/lsp/null-ls.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index f046ee8..8a95ba9 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -2,8 +2,8 @@ (module config.lsp.null-ls {autoload {util util}}) (let [null-ls (util.load-plugin :null-ls)] - (let [formatting null_ls.builtins.formatting - diagnostics null_ls.builtins.diagnostics] + (let [formatting null-ls.builtins.formatting + diagnostics null-ls.builtins.diagnostics] (null-ls.setup {:debug false :sources [diagnostics.flake8 diagnostics.golangci_lint -- cgit v1.2.3-70-g09d2 From 8a7e434c101c3d075dcf979e1aafea1a3d65470d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:57:06 +0200 Subject: feat(cmp): add more mappings --- fnl/config/cmp.fnl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index e4e16da..082303c 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -9,7 +9,15 @@ (cmp.setup {:snippet {:expand (fn [args] (luasnip.lsp_expand args.body))} :mapping {: (cmp.mapping.select_prev_item) - : (cmp.mapping.select_next_item)} + : (cmp.mapping.select_next_item) + : (cmp.mapping (cmp.mapping.scroll_docs -1) + [:i :c]) + : (cmp.mapping (cmp.mapping.scroll_docs 1) [:i :c]) + : (cmp.mapping (cmp.mapping.complete) [:i :c]) + : (cmp.mapping {:i (cmp.mapping.abort) + :c (cmp.mapping.close)}) + : (cmp.mapping.confirm {:select true}) + : (cmp.mapping.confirm {:select true})} :sources [{:name :nvim_lsp} {:name :nvim_lua} {:name :luasnip} @@ -29,4 +37,6 @@ "─" "╰" "│"]} + :confirm_opts {:behavior (cmp.ConfirmBehavior.Replace) + :select false} :experimental {:ghost_text false :native_menu false}})) -- cgit v1.2.3-70-g09d2 From 7dd11b2ceb386814e978b04c61edb29217480326 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:57:26 +0200 Subject: refactor(init): remove comments --- init.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 43946ea..78b668f 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,4 @@ --- Loads plugins for Neovim. - --- Bootstap essential plugins -require "bootstrap" - --- Load fennel config +-- Loads plugins for Neovim with fennel. vim.g["aniseed#env"] = { module = "init", compile = true, -- cgit v1.2.3-70-g09d2 From 3542e120015fa32a4c62c2b6eba036eb5252731c Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 20:44:55 +0200 Subject: fix(autocmd): hopefully fix bug --- fnl/config/autocmd.fnl | 87 ++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 49 deletions(-) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index ecec60a..e168bd5 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -1,50 +1,39 @@ ;; A customizable greeter. -(module config.autocmd {autoload {util util}}) - -(util.autocmd :FileType {:pattern [:qf :help :man :lspinfo] - :command "nnoremap q :close" - :group :_general_settings}) - -(util.autocmd :TextYankPost - {:pattern ["*"] - :callback (lambda [] - (vim.highlight.on_yank {:timeout 200})) - :group :_general_settings}) - -(util.autocmd :BufWinEnter - {:pattern ["*"] - :command ":set formatoptions-=cro" - :group :_general_settings}) - -(util.autocmd :FileType {:pattern [:qf] - :command "set nobuflisted" - :group :_general_settings}) - -(util.autocmd :FileType {:pattern [:gitcommit] - :command "setlocal wrap" - :group :_git}) - -(util.autocmd :FileType {:pattern [:gitcommit] - :command "setlocal spell" - :group :_git}) - -(util.autocmd :FileType {:pattern [:markdown] - :command "setlocal wrap" - :group :_markdown}) - -(util.autocmd :FileType {:pattern [:markdown] - :command "setlocal spell" - :group :_markdown}) - -(util.autocmd :VimResized {:pattern ["*"] - :command "tabdo wincmd =" - :group :_auto_resize}) - -(util.autocmd :User {:pattern [:AlphaReady] - :command "set showtabline=0 | autocmd BufUnload set showtabline=2" - :group :_alpha}) - -(util.autocmd :BufWritePost - {:pattern [:plugins.fnl] - :command "source | PackerSync" - :group :packer_user_config}) +(module config.autocmd {autoload {nvim aniseed.nvim util util}}) + +(defn autocmd [group cmds] + (nvim.command (.. "augroup " group)) + (nvim.command "autocmd!") + (each [_ cmd (ipairs cmds)] + (nvim.command (.. "autocmd " cmd))) + (nvim.command "augroup end")) + +(def- general-settings [ + "FileType qf,help,man,lspinfo nnoremap q :close" + "TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})" + "BufWinEnter * :set formatoptions-=cro" + "FileType qf set nobuflisted"]) + +(def- git [ + "FileType gitcommit setlocal wrap" + "FileType gitcommit setlocal spell"]) + +(def- markdown [ + "FileType markdown setlocal wrap" + "FileType markdown setlocal spell"]) + +(def- auto-resize [ + "VimResized * tabdo wincmd ="]) + +(def- alpha [ + "User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2"]) + +(def- packer [ + "BufWritePost plugins.lua source | PackerSync"]) + +(autocmd "_general_settings" general-settings) +(autocmd "_git" git) +(autocmd "_markdown" markdown) +(autocmd "_auto_resize" auto-resize) +(autocmd "_alpha" alpha) +(autocmd "packer_user_config" packer) -- cgit v1.2.3-70-g09d2 From 1d50839b9c03f77956132f776f6798140a13ac70 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 20:45:36 +0200 Subject: style: format --- fnl/config/autocmd.fnl | 65 ++++++++++++++++++++++---------------------------- fnl/config/init.fnl | 2 +- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index e168bd5..628a670 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -1,39 +1,32 @@ ;; A customizable greeter. (module config.autocmd {autoload {nvim aniseed.nvim util util}}) -(defn autocmd [group cmds] - (nvim.command (.. "augroup " group)) - (nvim.command "autocmd!") - (each [_ cmd (ipairs cmds)] - (nvim.command (.. "autocmd " cmd))) - (nvim.command "augroup end")) - -(def- general-settings [ - "FileType qf,help,man,lspinfo nnoremap q :close" - "TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})" - "BufWinEnter * :set formatoptions-=cro" - "FileType qf set nobuflisted"]) - -(def- git [ - "FileType gitcommit setlocal wrap" - "FileType gitcommit setlocal spell"]) - -(def- markdown [ - "FileType markdown setlocal wrap" - "FileType markdown setlocal spell"]) - -(def- auto-resize [ - "VimResized * tabdo wincmd ="]) - -(def- alpha [ - "User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2"]) - -(def- packer [ - "BufWritePost plugins.lua source | PackerSync"]) - -(autocmd "_general_settings" general-settings) -(autocmd "_git" git) -(autocmd "_markdown" markdown) -(autocmd "_auto_resize" auto-resize) -(autocmd "_alpha" alpha) -(autocmd "packer_user_config" packer) +(defn autocmd [group cmds] (nvim.command (.. "augroup " group)) + (nvim.command :autocmd!) + (each [_ cmd (ipairs cmds)] + (nvim.command (.. "autocmd " cmd))) (nvim.command "augroup end")) + +(def- general-settings ["FileType qf,help,man,lspinfo nnoremap q :close" + "TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})" + "BufWinEnter * :set formatoptions-=cro" + "FileType qf set nobuflisted"]) + +(def- git ["FileType gitcommit setlocal wrap" + "FileType gitcommit setlocal spell"]) + +(def- markdown ["FileType markdown setlocal wrap" + "FileType markdown setlocal spell"]) + +(def- auto-resize ["VimResized * tabdo wincmd ="]) + +(def- alpha + ["User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2"]) + +(def- packer ["BufWritePost plugins.lua source | PackerSync"]) + +(autocmd :_general_settings general-settings) +(autocmd :_git git) +(autocmd :_markdown markdown) +(autocmd :_auto_resize auto-resize) +(autocmd :_alpha alpha) +(autocmd :packer_user_config packer) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index 975288b..3ccff7d 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -1,8 +1,8 @@ ;; Load all plugin configs. (module config.init {require {_ config.impatient _ config.packer + _ config.autocmd _ config.alpha - ;;_ config.autocmd _ config.autopairs _ config.better-escape _ config.bufferline -- cgit v1.2.3-70-g09d2 From 81d4b2af14f381f632c57a3138b0e8027c3ba732 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 20:48:32 +0200 Subject: fix(cmp): remove fn call replace --- fnl/config/cmp.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index 082303c..50c0d85 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -37,6 +37,6 @@ "─" "╰" "│"]} - :confirm_opts {:behavior (cmp.ConfirmBehavior.Replace) + :confirm_opts {:behavior cmp.ConfirmBehavior.Replace :select false} :experimental {:ghost_text false :native_menu false}})) -- cgit v1.2.3-70-g09d2 From 5e87e7281aab88b8142bf44cd29ded2b7817e753 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 20:50:43 +0200 Subject: fix(bootstrap): move parenthesis --- fnl/bootstrap.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index 8ee3e0f..414b92a 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -13,13 +13,13 @@ (fmt "%s/packer/start/%s" packer-path repository)) (defn- ensure [user repository] - (let [path (ensure-path packer-path repository)]) + (let [path (ensure-path packer-path repository)] (if (> (vim.fn.empty (vim.fn.glob path) 0)) (do (execute (fmt git-clone-url user repository path)) (execute (fmt "packadd %s" repository)) true) - false)) + false))) (defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] (ensure :Olical :aniseed) -- cgit v1.2.3-70-g09d2 From aa75a843d4a84b3fd23db161914220dd403b8d5b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 20:56:56 +0200 Subject: fix(bootstrap): remove false --- fnl/bootstrap.fnl | 3 +-- fnl/install.fnl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index 414b92a..af16502 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -18,8 +18,7 @@ (do (execute (fmt git-clone-url user repository path)) (execute (fmt "packadd %s" repository)) - true) - false))) + true)))) (defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] (ensure :Olical :aniseed) diff --git a/fnl/install.fnl b/fnl/install.fnl index 9586948..cb5a588 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -8,7 +8,7 @@ (packer.startup (fn [use] (each [plugin opts (pairs plgs)] (use (a.assoc opts 1 plugin))))) - (if (= is_bootstrapped true) + (if is_bootstrapped? ((require :config.packer) .sync))) (local is_bootstrapped (bootstrap.run)) -- cgit v1.2.3-70-g09d2 From aff6d83d6626e9be675595c19852808d052ae5a4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:00:19 +0200 Subject: fix(bootstrap): add install fn --- fnl/bootstrap.fnl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index af16502..2496c13 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -12,13 +12,14 @@ (defn- ensure-path [packer-path repository] (fmt "%s/packer/start/%s" packer-path repository)) -(defn- ensure [user repository] - (let [path (ensure-path packer-path repository)] - (if (> (vim.fn.empty (vim.fn.glob path) 0)) - (do - (execute (fmt git-clone-url user repository path)) - (execute (fmt "packadd %s" repository)) - true)))) +(defn- install [user repository path] + (execute (fmt git-clone-url user repository path)) + (execute (fmt "packadd %s" repository))) + +(defn- ensure [user repository] (let [path (ensure-path packer-path repository)] + (if (> (vim.fn.empty (vim.fn.glob path) 0)) + (install user repository path) + true))) (defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] (ensure :Olical :aniseed) -- cgit v1.2.3-70-g09d2 From f65d898fe500211555290efe1c2409efe33043b9 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:02:14 +0200 Subject: fix(bootstrap): if statement --- fnl/bootstrap.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index 2496c13..b0b066d 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -18,8 +18,8 @@ (defn- ensure [user repository] (let [path (ensure-path packer-path repository)] (if (> (vim.fn.empty (vim.fn.glob path) 0)) - (install user repository path) - true))) + (install user repository path)) + true)) (defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] (ensure :Olical :aniseed) -- cgit v1.2.3-70-g09d2 From 77dc70369080389ddd783e8d847b18380844cb5b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:04:37 +0200 Subject: fix(bootstrap): if statement arg --- fnl/bootstrap.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl index b0b066d..0c41bb9 100644 --- a/fnl/bootstrap.fnl +++ b/fnl/bootstrap.fnl @@ -17,9 +17,9 @@ (execute (fmt "packadd %s" repository))) (defn- ensure [user repository] (let [path (ensure-path packer-path repository)] - (if (> (vim.fn.empty (vim.fn.glob path) 0)) + (if (> (vim.fn.empty (vim.fn.glob path)) 0) (install user repository path)) - true)) + true)) (defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] (ensure :Olical :aniseed) -- cgit v1.2.3-70-g09d2 From 250825c55823f30bc95a59454a2e1aeb278b5da4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:06:49 +0200 Subject: Revert "fix(bootstrap): remove lua impl" This reverts commit caf3656d5bc4d9f832791b424f5001828eaf4c49. --- bootstrap.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bootstrap.lua diff --git a/bootstrap.lua b/bootstrap.lua new file mode 100644 index 0000000..6147c84 --- /dev/null +++ b/bootstrap.lua @@ -0,0 +1,26 @@ +-- Bootstrap nvim with essential plugins. + +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command + +local function ensure(user, repository) + local packer_path = fn.stdpath "data" .. "/site/pack" + local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute( + fmt( + "!git clone --depth 1 https://github.com/%s/%s %s", + user, + repository, + ensure_path + ) + ) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") -- cgit v1.2.3-70-g09d2 From 815139e8a828e2bc049bf68682895291aad5aa04 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:09:21 +0200 Subject: fix(bootstrap): remove fnl impl --- fnl/bootstrap.fnl | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 fnl/bootstrap.fnl diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl deleted file mode 100644 index 0c41bb9..0000000 --- a/fnl/bootstrap.fnl +++ /dev/null @@ -1,27 +0,0 @@ -;; Bootstraping for fresh install -(module bootstrap {autoload {util util}}) - -(defn- fmt [s ...] (string.format s ...)) - -(def- packer-path (.. (vim.fn.stdpath :data) :site/pack)) - -(def- git-clone-url "!git clone --depth 1 https://github.com/%s/%s %s") - -(defn- execute [cmd] (vim.api.nvim_command cmd)) - -(defn- ensure-path [packer-path repository] - (fmt "%s/packer/start/%s" packer-path repository)) - -(defn- install [user repository path] - (execute (fmt git-clone-url user repository path)) - (execute (fmt "packadd %s" repository))) - -(defn- ensure [user repository] (let [path (ensure-path packer-path repository)] - (if (> (vim.fn.empty (vim.fn.glob path)) 0) - (install user repository path)) - true)) - -(defn run [] (let [is_bootstrapped (ensure :wbthomason :packer.nvim)] - (ensure :Olical :aniseed) - (ensure :lewis6991 :impatient.nvim) - is_bootstrapped)) -- cgit v1.2.3-70-g09d2 From b669753c7c1514e80cce44d7b403d829e465a602 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:09:41 +0200 Subject: fix(bootstrap): add bootstrap check --- bootstrap.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bootstrap.lua b/bootstrap.lua index 6147c84..a0b557d 100644 --- a/bootstrap.lua +++ b/bootstrap.lua @@ -3,6 +3,7 @@ local fn = vim.fn local fmt = string.format local execute = vim.api.nvim_command +local is_bootstrapped = false local function ensure(user, repository) local packer_path = fn.stdpath "data" .. "/site/pack" @@ -17,6 +18,9 @@ local function ensure(user, repository) ) ) execute(fmt("packadd %s", repository)) + if repository == "packer.nvim" then + is_bootstrapped = true + end end end @@ -24,3 +28,7 @@ end ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") ensure("lewis6991", "impatient.nvim") + +if is_bootstrapped then + require("packer").sync() +end -- cgit v1.2.3-70-g09d2 From 3a6f157ba8974f68de7e436e8ecbce1dacf2a439 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:11:15 +0200 Subject: fix(init): add loading of bootstrap lua --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 78b668f..7cc6bc9 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ -- Loads plugins for Neovim with fennel. +require "bootstrap" vim.g["aniseed#env"] = { module = "init", compile = true, -- cgit v1.2.3-70-g09d2 From a7a3e1e0de9d2ed94b655911e9aaf1b89e8990a5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:11:31 +0200 Subject: fix(install): remove check for bootstrapped --- fnl/install.fnl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index cb5a588..f6d741f 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -7,9 +7,6 @@ (defn- install-plugins [plgs] (packer.startup (fn [use] (each [plugin opts (pairs plgs)] - (use (a.assoc opts 1 plugin))))) - (if is_bootstrapped? - ((require :config.packer) .sync))) + (use (a.assoc opts 1 plugin)))))) -(local is_bootstrapped (bootstrap.run)) (install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From 5e5fac15095b4b2fb12c61e2b1049496b0c286ce Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:13:33 +0200 Subject: Revert "fix(bootstrap): add bootstrap check" This reverts commit b669753c7c1514e80cce44d7b403d829e465a602. --- bootstrap.lua | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bootstrap.lua b/bootstrap.lua index a0b557d..6147c84 100644 --- a/bootstrap.lua +++ b/bootstrap.lua @@ -3,7 +3,6 @@ local fn = vim.fn local fmt = string.format local execute = vim.api.nvim_command -local is_bootstrapped = false local function ensure(user, repository) local packer_path = fn.stdpath "data" .. "/site/pack" @@ -18,9 +17,6 @@ local function ensure(user, repository) ) ) execute(fmt("packadd %s", repository)) - if repository == "packer.nvim" then - is_bootstrapped = true - end end end @@ -28,7 +24,3 @@ end ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") ensure("lewis6991", "impatient.nvim") - -if is_bootstrapped then - require("packer").sync() -end -- cgit v1.2.3-70-g09d2 From 6dc7c2ef2a53a0fee742de19bfdd1e4a75a1a7c2 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:22:26 +0200 Subject: fix(bootstrap): test setting env var --- bootstrap.lua | 3 +++ fnl/install.fnl | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bootstrap.lua b/bootstrap.lua index 6147c84..d2f4161 100644 --- a/bootstrap.lua +++ b/bootstrap.lua @@ -17,6 +17,9 @@ local function ensure(user, repository) ) ) execute(fmt("packadd %s", repository)) + if repository == "packer.nvim" then + vim.env.BOOTSTRAPPED = true + end end end diff --git a/fnl/install.fnl b/fnl/install.fnl index f6d741f..faa91e6 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -7,6 +7,8 @@ (defn- install-plugins [plgs] (packer.startup (fn [use] (each [plugin opts (pairs plgs)] - (use (a.assoc opts 1 plugin)))))) + (use (a.assoc opts 1 plugin))))) + (if vim.env.BOOTSTRAPPED + (packer.sync))) (install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From 6a397a209d5dad871af751064507d6d4aaafbae7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:29:05 +0200 Subject: fix(bootstrap): try run vim env --- fnl/install.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index faa91e6..3f1f14b 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -8,7 +8,7 @@ (packer.startup (fn [use] (each [plugin opts (pairs plgs)] (use (a.assoc opts 1 plugin))))) - (if vim.env.BOOTSTRAPPED + (if (vim.env.BOOTSTRAPPED) (packer.sync))) (install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From 893f0a079932308eb5d403b443bd5658b7134e17 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:31:54 +0200 Subject: fix(bootstrap): try nil check --- fnl/install.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 3f1f14b..913d6c7 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -8,7 +8,7 @@ (packer.startup (fn [use] (each [plugin opts (pairs plgs)] (use (a.assoc opts 1 plugin))))) - (if (vim.env.BOOTSTRAPPED) + (if (vim.env.BOOTSTRAPPED)? (packer.sync))) (install-plugins plugins.plugins) -- cgit v1.2.3-70-g09d2 From 238d1235c185df38b7d5ba465547c7a004a09b57 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:34:17 +0200 Subject: fix(bootstrap): last fix --- fnl/install.fnl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 913d6c7..3a54c23 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -7,8 +7,8 @@ (defn- install-plugins [plgs] (packer.startup (fn [use] (each [plugin opts (pairs plgs)] - (use (a.assoc opts 1 plugin))))) - (if (vim.env.BOOTSTRAPPED)? - (packer.sync))) + (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) +(if (= (vim.env.BOOTSTRAPPED) true) + (packer.sync)) -- cgit v1.2.3-70-g09d2 From 1e61963630e4f2e3bc2e8fa07e46f79274311982 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:43:15 +0200 Subject: fix(packer): wip --- fnl/config/packer.fnl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl index 8354c07..e2f0792 100644 --- a/fnl/config/packer.fnl +++ b/fnl/config/packer.fnl @@ -3,5 +3,4 @@ (let [packer (util.load-plugin :packer)] (packer.init {:display {:open_fn (fn [] - ((require :packer.util) .float - {:border :rounded}))}})) + (packer.util.float {:border :rounded}))}})) -- cgit v1.2.3-70-g09d2 From 25118e087c66bc100a88c901ed283e2d9a8b6520 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 22:11:55 +0200 Subject: fix(bootstrap): env --- fnl/install.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 3a54c23..3b36502 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -10,5 +10,6 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -(if (= (vim.env.BOOTSTRAPPED) true) - (packer.sync)) +(let [is_bootstrapped vim.env.BOOTSTRAPPED] + (if is_bootstrapped? + (packer.sync))) -- cgit v1.2.3-70-g09d2 From 46dcf8fe18cddbb29db1fab6373feb9e817c963a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 22:26:19 +0200 Subject: fix(packer): wip --- fnl/config/packer.fnl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl index e2f0792..9d6a016 100644 --- a/fnl/config/packer.fnl +++ b/fnl/config/packer.fnl @@ -3,4 +3,5 @@ (let [packer (util.load-plugin :packer)] (packer.init {:display {:open_fn (fn [] - (packer.util.float {:border :rounded}))}})) + ((require :packer.util).float + {:border :rounded}))}})) -- cgit v1.2.3-70-g09d2 From 885b22bf9e7e291e091836894b45c5e6ec221811 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 22:54:35 +0200 Subject: fix(bootstrap): again --- bootstrap.lua | 3 --- fnl/install.fnl | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bootstrap.lua b/bootstrap.lua index d2f4161..6147c84 100644 --- a/bootstrap.lua +++ b/bootstrap.lua @@ -17,9 +17,6 @@ local function ensure(user, repository) ) ) execute(fmt("packadd %s", repository)) - if repository == "packer.nvim" then - vim.env.BOOTSTRAPPED = true - end end end diff --git a/fnl/install.fnl b/fnl/install.fnl index 3b36502..d4a4fdb 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -10,6 +10,6 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -(let [is_bootstrapped vim.env.BOOTSTRAPPED] - (if is_bootstrapped? - (packer.sync))) +(local path (vim.fn.stdpath (.. "data" "/site/pack/packer/start"))) +(if (= (vim.fn.empty (vim.fn.glob path)) 3) + (packer.sync)) -- cgit v1.2.3-70-g09d2 From 3dcabe8121c7b8a873fda33db7ad337e86a3633f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 23:45:28 +0200 Subject: fix: sync based on # paths --- fnl/init.fnl | 5 ++++- fnl/install.fnl | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index f62b1cf..7e6ddc7 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,2 +1,5 @@ ;; Install, load settings, and load plugin configs. -(module init {require {_ settings _ install _ config}}) +(module init) +(require :settings) +(require :install) +(require :config) diff --git a/fnl/install.fnl b/fnl/install.fnl index d4a4fdb..e518043 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -10,6 +10,6 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -(local path (vim.fn.stdpath (.. "data" "/site/pack/packer/start"))) -(if (= (vim.fn.empty (vim.fn.glob path)) 3) +(local path (.. (vim.fn.stdpath "data") "/site/pack/packer/start")) +(if (= (# (vim.fn.readdir path)) 3) (packer.sync)) -- cgit v1.2.3-70-g09d2 From e816ef784ac00d367de6d9334b167bf9533e5d7a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 23:49:04 +0200 Subject: fix(init): only read configs if plugins are dl --- fnl/init.fnl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index 7e6ddc7..f88b870 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -2,4 +2,5 @@ (module init) (require :settings) (require :install) -(require :config) +(if (> (# (vim.fn.readdir path)) 3) + (require :config)) -- cgit v1.2.3-70-g09d2 From 95944c1bde19418e9b8aa1c91622067945c7b1ea Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 23:49:33 +0200 Subject: style: format --- fnl/init.fnl | 4 ++-- fnl/install.fnl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index f88b870..567214f 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -2,5 +2,5 @@ (module init) (require :settings) (require :install) -(if (> (# (vim.fn.readdir path)) 3) - (require :config)) +(if (> (length (vim.fn.readdir path)) 3) + (require :config)) diff --git a/fnl/install.fnl b/fnl/install.fnl index e518043..f6b4501 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -10,6 +10,6 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -(local path (.. (vim.fn.stdpath "data") "/site/pack/packer/start")) -(if (= (# (vim.fn.readdir path)) 3) - (packer.sync)) +(local path (.. (vim.fn.stdpath :data) :/site/pack/packer/start)) +(if (= (length (vim.fn.readdir path)) 3) + (packer.sync)) -- cgit v1.2.3-70-g09d2 From d135c0f65a7f0703dd3428e8629396f4e2710ec7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 23:56:08 +0200 Subject: fix(load config): pre compute num plugins --- fnl/init.fnl | 4 ++-- fnl/install.fnl | 6 +++--- fnl/util.fnl | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index 567214f..4862b16 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,6 +1,6 @@ ;; Install, load settings, and load plugin configs. -(module init) +(module init {autoload {util util}}) (require :settings) (require :install) -(if (> (length (vim.fn.readdir path)) 3) +(if (> util.num-plugins 3) (require :config)) diff --git a/fnl/install.fnl b/fnl/install.fnl index f6b4501..50fbe24 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -2,7 +2,8 @@ (module install {autoload {a aniseed.core plugins plugins packer packer - bootstrap bootstrap}}) + bootstrap bootstrap + util util}}) (defn- install-plugins [plgs] (packer.startup (fn [use] @@ -10,6 +11,5 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -(local path (.. (vim.fn.stdpath :data) :/site/pack/packer/start)) -(if (= (length (vim.fn.readdir path)) 3) +(if (= util.num-plugins 3) (packer.sync)) diff --git a/fnl/util.fnl b/fnl/util.fnl index e6b4d9f..8bb3754 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -1,7 +1,8 @@ ;; Utility functions. (module util {autoload {nvim aniseed.nvim}}) -(defn autocmd [name opts] (nvim.ex.create_autocmd name opts)) +(def- path (.. (vim.fn.stdpath :data) :/site/pack/packer/start)) +(def num-plugins (length (vim.fn.readdir path))) (defn load-plugin [name] (let [(ok? val-or-err) (pcall require name)] -- cgit v1.2.3-70-g09d2 From 474b2c8db6b2e66a6d8313a17066f4d12e20720d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:03:28 +0200 Subject: fix(treesitter): do not dl all parser by default --- fnl/config/treesitter.fnl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl index a76ff32..73ef8a5 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/config/treesitter.fnl @@ -3,7 +3,24 @@ (module config.treesitter {autoload {util util}}) (let [treesitter (util.load-plugin :nvim-treesitter.configs)] - (treesitter.setup {:ensure_installed :all + (treesitter.setup {:ensure_installed [:c + :rust + :lua + :haskell + :python + :fennel + :org + :make + :go + :ocaml + :erlang + :vim + :yaml + :html + :toml + :dockerfile + :markdown + :latex] :sync_install false :ignore_install [""] :autopairs {:enable true} -- cgit v1.2.3-70-g09d2 From 4dcae0c53cbae623083ab0a7e7ff7bec8cca1070 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:14:16 +0200 Subject: refactor(bootstrap): mv to init --- bootstrap.lua | 26 -------------------------- init.lua | 31 ++++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 bootstrap.lua diff --git a/bootstrap.lua b/bootstrap.lua deleted file mode 100644 index 6147c84..0000000 --- a/bootstrap.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Bootstrap nvim with essential plugins. - -local fn = vim.fn -local fmt = string.format -local execute = vim.api.nvim_command - -local function ensure(user, repository) - local packer_path = fn.stdpath "data" .. "/site/pack" - local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) - if fn.empty(fn.glob(ensure_path)) > 0 then - execute( - fmt( - "!git clone --depth 1 https://github.com/%s/%s %s", - user, - repository, - ensure_path - ) - ) - execute(fmt("packadd %s", repository)) - end -end - --- Bootstrap install essential modules if not present -ensure("wbthomason", "packer.nvim") -ensure("Olical", "aniseed") -ensure("lewis6991", "impatient.nvim") diff --git a/init.lua b/init.lua index 7cc6bc9..90db1c4 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,34 @@ +-- Bootstrap nvim with essential plugins. +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command +local packer_path = fn.stdpath "data" .. "/site/pack/packer/start" + +local function ensure(user, repository) + local ensure_path = fmt("%s/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute( + fmt( + "!git clone --depth 1 https://github.com/%s/%s %s", + user, + repository, + ensure_path + ) + ) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") + +if #vim.fn.readdir(packer_path) == 3 then + require("packer").sync() +end + -- Loads plugins for Neovim with fennel. -require "bootstrap" vim.g["aniseed#env"] = { module = "init", compile = true, -- cgit v1.2.3-70-g09d2 From 9a1b6f1bc6db7413eebaef3eeca5904d396e43cb Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:14:38 +0200 Subject: fix(install): mv sync to bootstrap --- fnl/install.fnl | 2 -- 1 file changed, 2 deletions(-) diff --git a/fnl/install.fnl b/fnl/install.fnl index 50fbe24..825375a 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -11,5 +11,3 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) -(if (= util.num-plugins 3) - (packer.sync)) -- cgit v1.2.3-70-g09d2 From 250590f7723a449f70611deb2275ee05a463f8d2 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:21:35 +0200 Subject: Revert "fix(install): mv sync to bootstrap" This reverts commit 9a1b6f1bc6db7413eebaef3eeca5904d396e43cb. --- fnl/install.fnl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fnl/install.fnl b/fnl/install.fnl index 825375a..50fbe24 100644 --- a/fnl/install.fnl +++ b/fnl/install.fnl @@ -11,3 +11,5 @@ (use (a.assoc opts 1 plugin)))))) (install-plugins plugins.plugins) +(if (= util.num-plugins 3) + (packer.sync)) -- cgit v1.2.3-70-g09d2 From 40263320fa45f52741c55f5c6e78afbdaa7ee2e7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:25:51 +0200 Subject: fix(bootstrap): mv check of plugins back to install --- fnl/init.fnl | 4 +++- init.lua | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index 4862b16..00e8fc0 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -3,4 +3,6 @@ (require :settings) (require :install) (if (> util.num-plugins 3) - (require :config)) + (require :config) + (vim.notify "Not loading config before plugins are downloaded" + vim.log.levels.DEBUG)) diff --git a/init.lua b/init.lua index 90db1c4..e166864 100644 --- a/init.lua +++ b/init.lua @@ -24,10 +24,6 @@ ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") ensure("lewis6991", "impatient.nvim") -if #vim.fn.readdir(packer_path) == 3 then - require("packer").sync() -end - -- Loads plugins for Neovim with fennel. vim.g["aniseed#env"] = { module = "init", -- cgit v1.2.3-70-g09d2 From 25aa9cf364775086ff285f1291dc1644fc9920b4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 20:26:23 +0200 Subject: feat(setup): add setup shell script --- setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..ab86f04 --- /dev/null +++ b/setup.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +which nvim >/dev/null 2>&1 || echo "Neovim not installed!" && exit 1 +which luarocks >/dev/null 2>&1 || echo "Luarocks not installed!" && exit 1 +luarocks list | grep "fennel" || echo "fennel is not installed" && exit 1 + +nvim --headless +qa && nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" -- cgit v1.2.3-70-g09d2 From 4ea0d778ae1e6ef14c85aa833484830c17d33c99 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 20:51:17 +0200 Subject: fix(setup): mv to Makefile --- Makefile | 10 ++++++++++ setup.sh | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 Makefile delete mode 100644 setup.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..03ef64a --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +.POSIX: + +install: + which nvim >/dev/null 2>&1 || echo "Neovim not installed!" && exit 1 + which luarocks >/dev/null 2>&1 || echo "Luarocks not installed!" && exit 1 + luarocks list | grep "fennel" || echo "fennel is not installed" && exit 1 + nvim --headless +qa + nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" + +.PHONY: install diff --git a/setup.sh b/setup.sh deleted file mode 100644 index ab86f04..0000000 --- a/setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -which nvim >/dev/null 2>&1 || echo "Neovim not installed!" && exit 1 -which luarocks >/dev/null 2>&1 || echo "Luarocks not installed!" && exit 1 -luarocks list | grep "fennel" || echo "fennel is not installed" && exit 1 - -nvim --headless +qa && nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" -- cgit v1.2.3-70-g09d2 From ab96aca7daea5539655c60d627803c4f4c3d905e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 20:52:13 +0200 Subject: fix(init): remove logging --- fnl/init.fnl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fnl/init.fnl b/fnl/init.fnl index 00e8fc0..4862b16 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -3,6 +3,4 @@ (require :settings) (require :install) (if (> util.num-plugins 3) - (require :config) - (vim.notify "Not loading config before plugins are downloaded" - vim.log.levels.DEBUG)) + (require :config)) -- cgit v1.2.3-70-g09d2 From 9a9abafe16059dfd86c691efe4827d3767cada33 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 20:54:19 +0200 Subject: fix(makefile): indent --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 03ef64a..4b37a26 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .POSIX: install: - which nvim >/dev/null 2>&1 || echo "Neovim not installed!" && exit 1 - which luarocks >/dev/null 2>&1 || echo "Luarocks not installed!" && exit 1 - luarocks list | grep "fennel" || echo "fennel is not installed" && exit 1 - nvim --headless +qa - nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" + which nvim >/dev/null 2>&1 || echo "Neovim not installed!" && exit 1 + which luarocks >/dev/null 2>&1 || echo "Luarocks not installed!" && exit 1 + luarocks list | grep "fennel" || echo "fennel is not installed" && exit 1 + nvim --headless +qa + nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" .PHONY: install -- cgit v1.2.3-70-g09d2 From c561be2e3e71c226985640320559e3bf5e1c7034 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Tue, 12 Apr 2022 21:10:17 +0200 Subject: fix(make): bugs --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4b37a26..b4e3caa 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,9 @@ .POSIX: install: - which nvim >/dev/null 2>&1 || echo "Neovim not installed!" && exit 1 - which luarocks >/dev/null 2>&1 || echo "Luarocks not installed!" && exit 1 - luarocks list | grep "fennel" || echo "fennel is not installed" && exit 1 - nvim --headless +qa - nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" + $(which nvim >/dev/null 2>&1 || @echo "Neovim not installed!" && exit 1) + $(hich luarocks >/dev/null 2>&1 || @echo "Luarocks not installed!" && exit 1) + $(huarocks list | @grep "fennel" || @echo "fennel is not installed" && exit 1) + nvim --headless +qa && nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync" .PHONY: install -- cgit v1.2.3-70-g09d2