1
0
Fork 0
dotfiles/home/config/nvim/init.fnl

107 lines
3.2 KiB
Text
Raw Normal View History

2022-04-05 19:57:44 +00:00
(let [o vim.opt
g vim.g]
2022-04-05 19:57:44 +00:00
;; Preamble
2022-07-27 09:04:23 +00:00
(vim.cmd.filetype "plugin indent on")
2022-04-05 19:57:44 +00:00
(set o.shell :/bin/sh)
;; Various Options
(set o.spelllang [:en :de])
(set o.showmode false)
2023-07-28 23:37:08 +00:00
(set o.modeline true)
2022-04-05 19:57:44 +00:00
(set o.ruler false)
(set o.cursorline true)
(set o.list true)
(set o.listchars {:tab "»·"
:trail "·"
:nbsp "·"
:precedes "←"
:extends "→"})
(set o.showbreak "↪ ")
(set o.backspace [:indent :eol :start])
2023-01-11 21:45:22 +00:00
(set o.signcolumn :no)
2022-04-05 19:57:44 +00:00
(set o.startofline false)
(set o.synmaxcol 300)
(set o.viewoptions [:cursor :folds :slash :unix])
(set o.foldenable false)
;; Search
(set o.incsearch true)
(set o.grepprg "rg --vimgrep --no-heading")
(set o.grepformat "%f:%l:%c:%m,%f:%l:%m")
(set o.inccommand :nosplit)
;; Wrap
(set o.wrap true)
(set o.tabstop 2)
(set o.shiftwidth 2)
(set o.softtabstop 2)
(set o.expandtab true)
;; Splits
(set o.splitbelow true)
(set o.splitright true)
;; Diff
2023-01-14 16:07:11 +00:00
(set o.diffopt [:internal
:filler
"algorithm:histogram"
:indent-heuristic
"linematch:50"])
2022-04-05 19:57:44 +00:00
;; UI
(set o.number true)
(set o.relativenumber true)
(set o.conceallevel 2)
(set o.concealcursor :nc)
2022-12-20 19:26:57 +00:00
(set o.updatetime 1000)
(o.shortmess:append :S)
2022-04-05 19:57:44 +00:00
(set o.termguicolors true)
(set o.mouse :a)
(set o.mousemodel :popup_setpos)
2024-12-17 15:06:31 +00:00
(set o.mousemoveevent true)
2022-09-26 13:23:14 +00:00
(set o.cmdheight 1)
2023-10-04 21:58:26 +00:00
;(set o.showcmdloc :statusline)
2022-04-05 19:57:44 +00:00
;; Backups
(set o.backup false)
(set o.swapfile false)
(set o.undofile true)
(set o.undodir (.. (os.getenv :HOME) :/.local/share/nvim/undo//))
2023-11-16 23:12:19 +00:00
;; Clipboard
(let [clipboard (require :nifoc.clipboard)]
(clipboard.setup))
2022-04-16 22:24:03 +00:00
;; Theme
(let [theme (require :nifoc.theme)]
(theme.setup))
2022-04-05 19:57:44 +00:00
;; Plugins
(set g.mapleader " ") ; Some plugins need this, so set it before the keymap is loaded
2023-11-29 19:46:11 +00:00
(set o.timeoutlen 300)
2022-04-05 19:57:44 +00:00
(set g.loaded_python_provider 0) ; Disable built-in providers
2023-10-18 21:18:10 +00:00
(set g.loaded_python3_provider 0)
2022-04-05 19:57:44 +00:00
(set g.loaded_ruby_provider 0)
(set g.loaded_node_provider 0)
(set g.loaded_perl_provider 0)
(set g.loaded_matchit 1) ; Disable built-in plugins
(set g.loaded_matchparen 1)
(set g.loaded_gzip 1)
(set g.loaded_rrhelper 1)
(set g.loaded_tarPlugin 1)
(set g.loaded_zipPlugin 1)
(set g.loaded_netrwPlugin 1)
(set g.loaded_netrwFileHandlers 1)
(set g.loaded_netrwSettings 1)
(set g.loaded_2html_plugin 1)
(set g.loaded_vimballPlugin 1)
(set g.loaded_getscriptPlugin 1)
(set g.loaded_logipat 1)
(set g.loaded_tutor_mode_plugin 1)
(let [diagnostic (require :nifoc.diagnostic)
formatting (require :nifoc.formatting)]
(diagnostic.setup)
(formatting.setup))
2022-04-05 19:57:44 +00:00
(require :configuration.plugins)
;; Keymap
(let [keymap (require :nifoc.keymap)]
(keymap.setup))
;; Autocmds
(let [augroup (vim.api.nvim_create_augroup :NifocInit {:clear true})
aucmd vim.api.nvim_create_autocmd
ls (require :nifoc.line-style)]
(aucmd :InsertEnter {:callback #(ls.maybe-set-relativenumber false)
:group augroup})
(aucmd :InsertLeave {:callback #(ls.maybe-set-relativenumber true)
2022-04-17 19:44:56 +00:00
:group augroup})))