mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 05:42:22 +00:00
use fennel for packer config
This commit is contained in:
parent
d2d7afd367
commit
d2055b9191
10 changed files with 221 additions and 240 deletions
|
@ -9,22 +9,11 @@
|
|||
(macro make-errors-epic [f]
|
||||
`(xpcall #,f #(a.println (fennel.traceback $1))))
|
||||
|
||||
(make-errors-epic (require "plugins"))
|
||||
|
||||
(make-errors-epic (require "plugins.lsp"))
|
||||
(make-errors-epic (require "keybinds"))
|
||||
|
||||
|
||||
; called from packer config
|
||||
(fn _G.load_telescope []
|
||||
(require "plugins.telescope"))
|
||||
;(pkg telescope.nvim []
|
||||
;(make-errors-epic (require "plugins.telescope"))))
|
||||
|
||||
(pkg galaxyline.nvim []
|
||||
(make-errors-epic (require "plugins.galaxyline")))
|
||||
(pkg nvim-bufferline.lua []
|
||||
(make-errors-epic (require "plugins.bufferline")))
|
||||
|
||||
(def- colors utils.colors)
|
||||
|
||||
(pkg conjure []
|
||||
|
@ -70,39 +59,6 @@
|
|||
|
||||
; foldend
|
||||
|
||||
; gitsigns.nvim ------------------------------------------------------- foldstart
|
||||
; https://github.com/lewis6991/gitsigns.nvim
|
||||
(pkg gitsigns.nvim [gitsigns (require "gitsigns")]
|
||||
(gitsigns.setup
|
||||
{:signs {:add {:text "▍"}
|
||||
:change {:text "▍"}
|
||||
:delete {:text "▍"}
|
||||
:topdelete {:text "▍"}
|
||||
:changedelete {:text "▍"}}
|
||||
:keymaps {:noremap true
|
||||
:buffer true}
|
||||
:current_line_blame true
|
||||
:update_debounce 100})
|
||||
|
||||
(utils.highlight "GitSignsAdd" {:bg "NONE" :fg colors.bright_aqua})
|
||||
(utils.highlight "GitSignsDelete" {:bg "NONE" :fg colors.neutral_red})
|
||||
(utils.highlight "GitSignsChange" {:bg "NONE" :fg colors.bright_blue}))
|
||||
|
||||
; foldend
|
||||
|
||||
; :: diffview ------------------------------------------------------------------- foldstart
|
||||
(pkg diffview.nvim [diffview (require "diffview")
|
||||
cb (. (require "diffview.config") :diffview_callback)]
|
||||
(diffview.setup
|
||||
{:diff_binaries false
|
||||
:file_panel {:width 35
|
||||
:use_icons false}
|
||||
:key_bindings {:view {:<leader>dn (cb "select_next_entry")
|
||||
:<leader>dp (cb "select_prev_entry")
|
||||
:<leader>dd (cb "toggle_files")}}}))
|
||||
|
||||
; foldend
|
||||
|
||||
; :: and _ as space ------------------------------------------------------------------- foldstart
|
||||
(var remapped-space nil)
|
||||
(fn _G.RebindShit [newKey]
|
||||
|
@ -129,12 +85,4 @@
|
|||
; foldend
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; vim:foldmarker=foldstart,foldend
|
||||
|
|
|
@ -28,7 +28,21 @@
|
|||
(fn [name mappings ...]
|
||||
(if (~= nil (. packer_plugins `,(tostring name)))
|
||||
`(let ,mappings ,...)
|
||||
(print (.. "plugin disabled " `,(tostring name)))))}
|
||||
(print (.. "plugin disabled " `,(tostring name)))))
|
||||
|
||||
:each-pair
|
||||
(fn [args ...]
|
||||
(let [[l# r# d#] args]
|
||||
`(let [data# ,d#]
|
||||
(for [i# 1 (a.count data#) 2]
|
||||
(let [,l# (. data# i#)
|
||||
,r# (. data# (+ i# 1))]
|
||||
,...)))))}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
133
files/.config/nvim/fnl/plugins.fnl
Normal file
133
files/.config/nvim/fnl/plugins.fnl
Normal file
|
@ -0,0 +1,133 @@
|
|||
(module plugins
|
||||
{require {utils utils
|
||||
a aniseed.core
|
||||
packer packer}
|
||||
require-macros [macros]})
|
||||
|
||||
(defn safe-require-plugin-config [name]
|
||||
(xpcall
|
||||
#(require name)
|
||||
#(a.println (.. "Error sourcing " name ":\n" (fennel.traceback $1)))))
|
||||
|
||||
(defn- use [...]
|
||||
"Iterates through the arguments as pairs and calls packer's function for
|
||||
each of them. Works around Fennel not liking mixed associative and sequential
|
||||
tables as well."
|
||||
(let [pkgs [...]]
|
||||
(packer.startup
|
||||
(fn [use]
|
||||
(each-pair [name opts pkgs]
|
||||
(-?> (. opts :mod) (safe-require-plugin-config))
|
||||
(use (a.assoc opts 1 name)))))))
|
||||
|
||||
|
||||
(use
|
||||
:nvim-telescope/telescope.nvim {:mod "plugins.telescope"
|
||||
:requires [:nvim-lua/popup.nvim :nvim-lua/plenary.nvim]}
|
||||
|
||||
:p00f/nvim-ts-rainbow {}
|
||||
:romgrk/nvim-treesitter-context {}
|
||||
:JoosepAlviste/nvim-ts-context-commentstring {}
|
||||
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate"}
|
||||
|
||||
; :code-biscuits/nvim-biscuits {} ; show opening line after closing curly
|
||||
|
||||
:folke/which-key.nvim {}
|
||||
|
||||
:pwntester/octo.nvim {}
|
||||
|
||||
; json query stuff
|
||||
:gennaro-tedesco/nvim-jqx {:ft ["json"]}
|
||||
|
||||
:Olical/aniseed {}; :tag "v3.16.0"}
|
||||
|
||||
; general purpose lua wrappers for nvim stuff
|
||||
:norcalli/nvim.lua {}
|
||||
|
||||
:glepnir/galaxyline.nvim {:mod "plugins.galaxyline"}
|
||||
:akinsho/nvim-bufferline.lua {:mod "plugins.bufferline"}
|
||||
|
||||
:sindrets/diffview.nvim {:mod "plugins.diffview"}
|
||||
:tweekmonster/startuptime.vim {:cmd ["StartupTime"]}
|
||||
:tpope/vim-repeat {}
|
||||
|
||||
:junegunn/goyo.vim {:cmd "Goyo"}
|
||||
|
||||
:lewis6991/gitsigns.nvim {:mod "plugins.gitsigns"}
|
||||
|
||||
:gruvbox-community/gruvbox {}
|
||||
|
||||
:tpope/vim-fugitive {}
|
||||
:preservim/nerdcommenter {}
|
||||
:godlygeek/tabular {} ; :Tab /regex can align code on occurrences of the given regex. I.e. :Tab /= aligns all = signs in a block.
|
||||
:tpope/vim-surround {}
|
||||
:christoomey/vim-tmux-navigator {} ; good integration with tmux pane switching
|
||||
:nathanaelkane/vim-indent-guides {} ; Can be toggled using <leader>ig (intent-guides)
|
||||
|
||||
; <C-n> to select current word. <C-n> to select next occurrence.
|
||||
; with multiple lines selected in Visual mode, <C-n> to insert cursor in each line. I not i to insert in Visual-mode.
|
||||
:terryma/vim-multiple-cursors {}
|
||||
:mg979/vim-visual-multi {}
|
||||
:hauleth/sad.vim {} ; Use siw instead of ciw. when using . afterwards, will find the next occurrence of the changed word and change it too
|
||||
:wellle/targets.vim {} ; more text objects. IE: cin (change in next parens). generally better handling of surrounding objects.
|
||||
:unblevable/quick-scope {} ; highlight targets when pressing f<character>
|
||||
|
||||
:iamcco/markdown-preview.nvim {:run vim.fn.mkdp#util#install}
|
||||
|
||||
; code-related ----------------------------------------- <<<
|
||||
|
||||
:folke/lsp-trouble.nvim {}
|
||||
:simrat39/symbols-outline.nvim {}
|
||||
:neovim/nvim-lspconfig {}
|
||||
:hrsh7th/nvim-compe {}
|
||||
:glepnir/lspsaga.nvim {}
|
||||
|
||||
|
||||
:Olical/conjure {}
|
||||
:tami5/compe-conjure {}
|
||||
|
||||
:machakann/vim-highlightedyank {}
|
||||
:ciaranm/detectindent {}
|
||||
:pechorin/any-jump.vim {}
|
||||
:justinmk/vim-sneak {}
|
||||
:psliwka/vim-smoothie {}
|
||||
:editorconfig/editorconfig-vim {}
|
||||
:honza/vim-snippets {}
|
||||
:tommcdo/vim-exchange {}
|
||||
:kien/rainbow_parentheses.vim {}
|
||||
|
||||
:bhurlow/vim-parinfer {:ft ["fennel" "carp" "lisp" "elisp"]}
|
||||
|
||||
:bduggan/vim-raku {:ft ["raku"]}
|
||||
:LnL7/vim-nix {:ft ["nix"]}
|
||||
|
||||
:kevinoid/vim-jsonc {}
|
||||
|
||||
:ap/vim-css-color {}
|
||||
:pangloss/vim-javascript {} ; syntax highlighting JS
|
||||
:ianks/vim-tsx {}
|
||||
:leafgarland/typescript-vim {}
|
||||
:sheerun/vim-polyglot {} ; Syntax highlighting for most languages
|
||||
:HerringtonDarkholme/yats.vim {} ; typescript syntax highlighting
|
||||
:mxw/vim-jsx {}
|
||||
;:mattn/emmet-vim {}
|
||||
|
||||
:purescript-contrib/purescript-vim {}
|
||||
|
||||
|
||||
:derekelkins/agda-vim {:ft ["agda"]}
|
||||
:neovimhaskell/haskell-vim { :ft ["haskell"]}
|
||||
|
||||
:rust-lang/rust.vim {:ft ["rust"]
|
||||
:requires ["mattn/webapi-vim"]}
|
||||
:simrat39/rust-tools.nvim {:ft ["rust"]}
|
||||
:ray-x/lsp_signature.nvim {}
|
||||
|
||||
:bakpakin/fennel.vim {}
|
||||
:tjdevries/nlua.nvim {})
|
||||
; >>>
|
||||
|
||||
|
||||
; vim:foldmarker=<<<,>>>
|
||||
|
||||
|
11
files/.config/nvim/fnl/plugins/diffview.fnl
Normal file
11
files/.config/nvim/fnl/plugins/diffview.fnl
Normal file
|
@ -0,0 +1,11 @@
|
|||
(module plugins.diffview
|
||||
{autoload {diffview diffview
|
||||
cb diffview.config}})
|
||||
|
||||
(diffview.setup
|
||||
{:diff_binaries false
|
||||
:file_panel {:width 35
|
||||
:use_icons false}
|
||||
:key_bindings {:view {:<leader>dn (cb.diffview_callback "select_next_entry")
|
||||
:<leader>dp (cb.diffview_callback "select_prev_entry")
|
||||
:<leader>dd (cb.diffview_callback "toggle_files")}}})
|
19
files/.config/nvim/fnl/plugins/gitsigns.fnl
Normal file
19
files/.config/nvim/fnl/plugins/gitsigns.fnl
Normal file
|
@ -0,0 +1,19 @@
|
|||
(module plugins.gitsigns
|
||||
{autoload {utils utils
|
||||
gitsigns gitsigns}})
|
||||
|
||||
; ; https://github.com/lewis6991/gitsigns.nvim
|
||||
; (gitsigns.setup
|
||||
; {:signs {:add {:text "▍"}
|
||||
; :change {:text "▍"}
|
||||
; :delete {:text "▍"}
|
||||
; :topdelete {:text "▍"}
|
||||
; :changedelete {:text "▍"}}
|
||||
; :keymaps {:noremap true
|
||||
; :buffer true}
|
||||
; :current_line_blame true
|
||||
; :update_debounce 100})
|
||||
;
|
||||
; (utils.highlight "GitSignsAdd" {:bg "NONE" :fg colors.bright_aqua})
|
||||
; (utils.highlight "GitSignsDelete" {:bg "NONE" :fg colors.neutral_red})
|
||||
; (utils.highlight "GitSignsChange" {:bg "NONE" :fg colors.bright_blue})
|
|
@ -1,15 +1,11 @@
|
|||
(module plugins.telescope
|
||||
{require {a aniseed.core
|
||||
fennel aniseed.fennel
|
||||
nvim aniseed.nvim
|
||||
utils utils
|
||||
|
||||
{require {utils utils
|
||||
telescope telescope
|
||||
actions telescope.actions}})
|
||||
|
||||
(telescope.setup
|
||||
(telescope.setup
|
||||
{:defaults
|
||||
{:i { "<esc>" actions.close}}})
|
||||
{:i { "<esc>" actions.close}}})
|
||||
|
||||
(telescope.load_extension "media_files")
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(module utils
|
||||
{require {a aniseed.core
|
||||
fennel aniseed.fennel
|
||||
nvim aniseed.nvim}
|
||||
{autoload {a aniseed.core
|
||||
fennel aniseed.fennel
|
||||
nvim aniseed.nvim}
|
||||
require-macros [macros]})
|
||||
|
||||
(def req
|
||||
|
@ -43,8 +43,16 @@
|
|||
(nvim.buf_del_keymap 0 mode from)
|
||||
(nvim.del_keymap mode from)))
|
||||
|
||||
|
||||
|
||||
(defn- use [...]
|
||||
"Iterates through the arguments as pairs and calls packer's function for
|
||||
each of them. Works around Fennel not liking mixed associative and sequential
|
||||
tables as well."
|
||||
(let [pkgs [...]]
|
||||
(packer.startup
|
||||
(fn [use]
|
||||
(each-pair [name opts pkgs]
|
||||
(-?> (. opts :mod) (safe-require-plugin-config))
|
||||
(use (a.assoc opts 1 name)))))))
|
||||
|
||||
(def colors
|
||||
{ :dark0_hard "#1d2021"
|
||||
|
|
|
@ -9,14 +9,37 @@
|
|||
let g:vim_config_root = expand('<sfile>:p:h')
|
||||
let $VIM_ROOT = g:vim_config_root
|
||||
|
||||
luafile $VIM_ROOT/plugins.lua
|
||||
lua << EOF
|
||||
local pack_path = vim.fn.stdpath("data") .. "/site/pack"
|
||||
|
||||
function ensure(user, repo)
|
||||
-- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory.
|
||||
local install_path = string.format("%s/packer/start/%s", pack_path, repo, repo)
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
vim.api.nvim_command(string.format("!git clone https://github.com/%s/%s %s", user, repo, install_path))
|
||||
vim.api.nvim_command(string.format("packadd %s", repo))
|
||||
end
|
||||
end
|
||||
|
||||
-- Bootstrap essential plugins required for installing and loading the rest.
|
||||
ensure("wbthomason", "packer.nvim")
|
||||
ensure("Olical", "aniseed")
|
||||
|
||||
vim.g["aniseed#env"] = { compile = true }
|
||||
EOF
|
||||
|
||||
"luafile $VIM_ROOT/plugins.lua
|
||||
|
||||
if &shell =~# 'fish$'
|
||||
set shell=bash
|
||||
endif
|
||||
|
||||
let mapleader ="\<Space>"
|
||||
let maplocalleader = "m"
|
||||
|
||||
" ewwwwwwwwwwwwwwwwwwwww
|
||||
let maplocalleader = ','
|
||||
|
||||
"let maplocalleader = 'm'
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,171 +0,0 @@
|
|||
local execute = vim.api.nvim_command
|
||||
local fn = vim.fn
|
||||
|
||||
local install_path = fn.stdpath("data").."/site/pack/packer/opt/packer.nvim"
|
||||
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({"git", "clone", "https://github.com/wbthomason/packer.nvim", install_path})
|
||||
execute "packadd packer.nvim"
|
||||
end
|
||||
|
||||
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
require("packer").startup(function(use)
|
||||
|
||||
--use_rocks "rtsisyk/fun"
|
||||
|
||||
use "tami5/compe-conjure"
|
||||
|
||||
use "pwntester/octo.nvim"
|
||||
|
||||
use "Olical/conjure"
|
||||
|
||||
use "p00f/nvim-ts-rainbow"
|
||||
use "romgrk/nvim-treesitter-context"
|
||||
use "JoosepAlviste/nvim-ts-context-commentstring"
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate"
|
||||
}
|
||||
|
||||
--use "code-biscuits/nvim-biscuits"
|
||||
|
||||
use "simrat39/symbols-outline.nvim"
|
||||
use "folke/which-key.nvim"
|
||||
use "folke/lsp-trouble.nvim"
|
||||
|
||||
use "sindrets/diffview.nvim"
|
||||
|
||||
|
||||
-- better quickfix window
|
||||
--use "kevinhwang91/nvim-bqf"
|
||||
|
||||
-- json query stuff
|
||||
use {
|
||||
"gennaro-tedesco/nvim-jqx",
|
||||
ft = { "json" }
|
||||
}
|
||||
|
||||
|
||||
use {
|
||||
"Olical/aniseed",
|
||||
--tag = "v3.16.0"
|
||||
}
|
||||
|
||||
-- general purpose lua wrappers for nvim stuff
|
||||
use "norcalli/nvim.lua"
|
||||
|
||||
use "akinsho/nvim-bufferline.lua"
|
||||
use "tweekmonster/startuptime.vim"
|
||||
use "tpope/vim-repeat"
|
||||
use {
|
||||
"junegunn/goyo.vim",
|
||||
cmd = "Goyo",
|
||||
}
|
||||
|
||||
--use "mhinz/vim-signify"
|
||||
use "lewis6991/gitsigns.nvim"
|
||||
|
||||
use "tpope/vim-fugitive"
|
||||
use "preservim/nerdcommenter"
|
||||
use "glepnir/galaxyline.nvim"
|
||||
use "gruvbox-community/gruvbox"
|
||||
use "godlygeek/tabular" -- :Tab /regex can align code on occurrences of the given regex. I.e. :Tab /= aligns all = signs in a block.
|
||||
use "tpope/vim-surround"
|
||||
use "christoomey/vim-tmux-navigator" -- good integration with tmux pane switching
|
||||
use "nathanaelkane/vim-indent-guides" -- Can be toggled using <leader>ig (intent-guides)
|
||||
|
||||
-- <C-n> to select current word. <C-n> to select next occurrence.
|
||||
-- with multiple lines selected in Visual mode, <C-n> to insert cursor in each line. I not i to insert in Visual-mode.
|
||||
-- use "terryma/vim-multiple-cursors"
|
||||
use "mg979/vim-visual-multi"
|
||||
use "hauleth/sad.vim" -- Use siw instead of ciw. when using . afterwards, will find the next occurrence of the changed word and change it too
|
||||
use "wellle/targets.vim" -- more text objects. IE: cin) (change in next parens). generally better handling of surrounding objects.
|
||||
use "unblevable/quick-scope" -- highlight targets when pressing f<character>
|
||||
|
||||
use {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = vim.fn["mkdp#util#install"]
|
||||
}
|
||||
|
||||
use "machakann/vim-highlightedyank"
|
||||
use "ciaranm/detectindent"
|
||||
use "pechorin/any-jump.vim"
|
||||
use "justinmk/vim-sneak"
|
||||
use "psliwka/vim-smoothie"
|
||||
use "editorconfig/editorconfig-vim"
|
||||
use "honza/vim-snippets"
|
||||
use "tommcdo/vim-exchange"
|
||||
use "kien/rainbow_parentheses.vim"
|
||||
|
||||
--use {
|
||||
--"eraserhd/parinfer-rust",
|
||||
--run = "cargo build --release"
|
||||
--}
|
||||
use "bhurlow/vim-parinfer"
|
||||
|
||||
|
||||
use "ray-x/lsp_signature.nvim"
|
||||
|
||||
-- Language Plugins ----------------------------------------------------- {{{
|
||||
|
||||
use "bduggan/vim-raku"
|
||||
use "LnL7/vim-nix"
|
||||
|
||||
use "kevinoid/vim-jsonc"
|
||||
|
||||
use "ap/vim-css-color"
|
||||
use "pangloss/vim-javascript" -- syntax highlighting JS
|
||||
use "ianks/vim-tsx"
|
||||
use "leafgarland/typescript-vim"
|
||||
use "sheerun/vim-polyglot" -- Syntax highlighting for most languages
|
||||
-- use "mattn/emmet-vim"
|
||||
|
||||
use "purescript-contrib/purescript-vim"
|
||||
|
||||
use "HerringtonDarkholme/yats.vim" -- typescript syntax highlighting
|
||||
use "mxw/vim-jsx"
|
||||
|
||||
-- Haskell
|
||||
use "neovimhaskell/haskell-vim"
|
||||
|
||||
-- Rust
|
||||
use "rust-lang/rust.vim"
|
||||
use "mattn/webapi-vim"
|
||||
|
||||
use "bakpakin/fennel.vim"
|
||||
use "tjdevries/nlua.nvim"
|
||||
|
||||
-- use "mxw/vim-prolog"
|
||||
|
||||
|
||||
use "simrat39/rust-tools.nvim"
|
||||
|
||||
use "neovim/nvim-lspconfig"
|
||||
|
||||
-- use "nvim-lua/completion-nvim"
|
||||
use "hrsh7th/nvim-compe"
|
||||
use "glepnir/lspsaga.nvim"
|
||||
-- use "cohama/lexima.vim"
|
||||
|
||||
use "nvim-lua/popup.nvim"
|
||||
use "nvim-lua/plenary.nvim"
|
||||
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = { "Telescope" },
|
||||
config = function()
|
||||
_G.load_telescope()
|
||||
end
|
||||
}
|
||||
|
||||
--use "RishabhRD/popfix"
|
||||
--use "RishabhRD/nvim-lsputils"
|
||||
|
||||
use "nvim-telescope/telescope-media-files.nvim"
|
||||
|
||||
-- }}}
|
||||
|
||||
end)
|
||||
|
|
@ -20,7 +20,7 @@ in
|
|||
cool-retro-term
|
||||
gromit-mpx
|
||||
polybarFull
|
||||
discord
|
||||
#discord
|
||||
pinta
|
||||
espanso
|
||||
barrier
|
||||
|
|
Loading…
Reference in a new issue