dots-of-war/files/.config/nvim/fnl/init.fnl

135 lines
4 KiB
Text
Raw Normal View History

2021-04-03 14:14:56 +00:00
(module init
2021-05-06 17:35:35 +00:00
{require {utils utils
2021-05-01 13:20:02 +00:00
str aniseed.string
2021-05-06 17:35:35 +00:00
nvim aniseed.nvim
a aniseed.core
fennel aniseed.fennel}
2021-05-01 13:20:02 +00:00
require-macros [macros]})
2021-04-03 18:34:15 +00:00
2021-05-03 20:16:55 +00:00
(macro make-errors-epic [f]
`(xpcall #,f #(a.println (fennel.traceback $1))))
(make-errors-epic (require "plugins.lsp"))
2021-05-06 17:35:35 +00:00
(make-errors-epic (require "keybinds"))
2021-05-03 20:16:55 +00:00
2021-05-06 17:35:35 +00:00
(pkg telescope.nvim []
(make-errors-epic (require "plugins.telescope")))
2021-05-06 17:35:35 +00:00
(pkg galaxyline.nvim []
(make-errors-epic (require "plugins.galaxyline")))
2021-05-06 17:35:35 +00:00
(pkg nvim-bufferline.lua []
(make-errors-epic (require "plugins.bufferline")))
2021-04-23 14:46:45 +00:00
(def- colors utils.colors)
2021-05-02 11:54:58 +00:00
2021-05-06 17:35:35 +00:00
(pkg conjure []
(set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed."))
2021-05-02 11:54:58 +00:00
; Colors ------------------------------------------------------- foldstart
(utils.highlight-add
2021-05-02 15:15:33 +00:00
["GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"]
{:bg "NONE"})
2021-05-02 11:54:58 +00:00
; foldend
2021-05-01 13:20:02 +00:00
2021-05-02 10:32:09 +00:00
; Treesitter ------------------------------------------------------- foldstart
2021-05-02 15:15:33 +00:00
2021-05-06 17:35:35 +00:00
(pkg nvim-treesitter [configs (require "nvim-treesitter.configs")]
(configs.setup
{:ensure_installed "all"
:highlight {:enable true
:disable ["fennel"]}
;:indent {:enable true}
;:disable ["lua"]}
:incremental_selection
{:enable true
:keymaps {:init_selection "gss"
:node_incremental "gsl"
:node_decremental "gsh"
:scope_incremental "gsj"
:scope_decremental "gsk"}}
2021-05-02 15:15:33 +00:00
; disabled due to it fucking with gitsigns.nvim
;:rainbow { :enable true
;:extended_mode true}
2021-05-02 15:15:33 +00:00
:context_commentstring {:enable true}}))
2021-04-30 14:26:31 +00:00
2021-05-01 10:01:13 +00:00
;(nvim-biscuits.setup {}
;{ :on_events ["InsertLeave" "CursorHoldI"]})
2021-04-30 16:23:38 +00:00
2021-05-02 10:32:09 +00:00
; foldend
2021-05-01 10:01:13 +00:00
2021-05-02 10:32:09 +00:00
; gitsigns.nvim ------------------------------------------------------- foldstart
2021-04-30 16:23:38 +00:00
; https://github.com/lewis6991/gitsigns.nvim
2021-05-06 17:35:35 +00:00
(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}))
2021-04-30 16:23:38 +00:00
2021-05-02 10:32:09 +00:00
; foldend
; :: diffview ------------------------------------------------------------------- foldstart
2021-05-06 17:35:35 +00:00
(pkg diffview.nvim [diffview (require "diffview")
cb (. (require "diffview.config") :diffview_callback)]
2021-05-02 10:32:09 +00:00
(diffview.setup
2021-05-02 15:15:33 +00:00
{: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")}}}))
2021-04-30 16:23:38 +00:00
2021-05-02 10:32:09 +00:00
; foldend
2021-05-01 13:20:02 +00:00
2021-05-02 10:32:09 +00:00
; :: and _ as space ------------------------------------------------------------------- foldstart
2021-04-23 14:46:45 +00:00
(var remapped-space nil)
(fn _G.RebindShit [newKey]
(set remapped-space {:old (vim.fn.maparg :<Space> :i)
:cur newKey})
(utils.keymap :i :<Space> newKey {:buffer true}))
2021-04-02 17:54:14 +00:00
2021-04-23 14:46:45 +00:00
(fn _G.UnbindSpaceStuff []
2021-05-02 15:15:33 +00:00
(when (and remapped-space (~= remapped-space {}))
(utils.del-keymap :i :<Space> true)
(when (~= remapped-space.old "")
(utils.keymap :i :<Space> remapped-space.old {:buffer true}))
(set remapped-space nil)))
2021-04-23 16:09:31 +00:00
2021-04-23 14:46:45 +00:00
(nvim.command "autocmd! InsertLeave * :call v:lua.UnbindSpaceStuff()")
(utils.keymap :n "<Tab>j" ":call v:lua.RebindShit('_')<CR>")
(utils.keymap :n "<Tab>k" ":call v:lua.RebindShit('::')<CR>")
(utils.keymap :i "<Tab>j" "<space><C-o>:call v:lua.RebindShit('_')<CR>")
(utils.keymap :i "<Tab>k" "<space><C-o>:call v:lua.RebindShit('::')<CR>")
(utils.keymap :n "ö" "a")
2021-04-18 10:03:50 +00:00
2021-05-02 10:32:09 +00:00
; foldend
2021-04-30 14:26:31 +00:00
2021-05-02 11:03:31 +00:00
2021-05-02 10:32:09 +00:00
; vim:foldmarker=foldstart,foldend