2022-04-25 23:52:08 +02:00
|
|
|
local set = vim.opt
|
2022-04-27 00:24:23 +02:00
|
|
|
local cmd = vim.api.nvim_command
|
|
|
|
local au = vim.api.nvim_create_autocmd
|
|
|
|
local plug = vim.fn['plug#']
|
2022-04-25 23:52:08 +02:00
|
|
|
vim.call('plug#begin', '~/.config/nvim/plugged')
|
2022-04-27 00:24:23 +02:00
|
|
|
plug('https://gitlab.com/rawleyIfowler/melange')
|
2022-04-28 05:31:41 +02:00
|
|
|
plug('clojure-vim/clojure.vim', {['for'] = 'clojure'})
|
2022-04-27 00:24:23 +02:00
|
|
|
plug('scrooloose/nerdtree', {on = 'NERDTreeToggle'})
|
|
|
|
plug('tpope/vim-surround')
|
|
|
|
plug('tpope/vim-fireplace', {['for'] = 'clojure'})
|
|
|
|
plug('neovim/nvim-lsp')
|
|
|
|
plug('neovim/nvim-lspconfig')
|
|
|
|
plug('junegunn/goyo.vim', {['for'] = 'markdown'})
|
|
|
|
plug('junegunn/fzf', {['dir'] = '~/.fzf', ['do'] = './install --all'})
|
|
|
|
plug('junegunn/fzf.vim')
|
2022-04-28 05:31:41 +02:00
|
|
|
plug('jiangmiao/auto-pairs')
|
2022-04-27 00:24:23 +02:00
|
|
|
plug('guns/vim-clojure-highlight', {['for'] = 'clojure'})
|
|
|
|
plug('guns/vim-clojure-static', {['for'] = 'clojure'})
|
|
|
|
plug('luochen1990/rainbow', {['for'] = 'clojure'})
|
|
|
|
plug('docunext/closetag.vim')
|
2022-04-29 21:17:58 +02:00
|
|
|
plug('norcalli/nvim_utils')
|
2022-04-25 23:52:08 +02:00
|
|
|
vim.call('plug#end')
|
2022-04-29 21:17:58 +02:00
|
|
|
pcall(require, 'nvim_utils')
|
2022-04-25 23:52:08 +02:00
|
|
|
-- Basic editor configurations
|
|
|
|
set.tabstop = 4
|
|
|
|
set.shiftwidth = 4
|
|
|
|
set.softtabstop = 4
|
|
|
|
set.expandtab = true
|
|
|
|
set.number = true
|
|
|
|
set.termguicolors = true
|
|
|
|
set.autoindent = true
|
|
|
|
set.autowrite = true
|
|
|
|
set.ai = true
|
|
|
|
set.wildignore = {'*/cache/*', '*/tmp*'}
|
|
|
|
-- Keybindings
|
2022-04-29 21:17:58 +02:00
|
|
|
function nnoremap(mode, lhs, rhs, opts)
|
|
|
|
local options = { noremap = true }
|
|
|
|
if opts then
|
|
|
|
options = vim.tbl_extend("force", options, opts)
|
|
|
|
end
|
|
|
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
|
|
|
end
|
2022-04-25 23:52:08 +02:00
|
|
|
---- NERDTree
|
2022-04-29 21:17:58 +02:00
|
|
|
nnoremap('n', '<S-w>', ':NERDTreeToggle<cr>')
|
|
|
|
nnoremap('n', '<S-q>', ':NERDTreeClose<cr>')
|
2022-04-25 23:52:08 +02:00
|
|
|
---- Ripgrep
|
2022-04-29 21:17:58 +02:00
|
|
|
nnoremap('n', '<C-f>', ':Rg<cr>')
|
2022-04-25 23:52:08 +02:00
|
|
|
-- Colors
|
|
|
|
vim.cmd('syntax enable')
|
|
|
|
vim.cmd('colorscheme melange')
|
|
|
|
vim.o.background = 'dark'
|
2022-04-29 21:17:58 +02:00
|
|
|
-- Clojure/Common Lisp specific configurations
|
|
|
|
-- Clojure and Common Lisp style is 2 space indent
|
|
|
|
-- https://guide.clojure.style
|
|
|
|
vim.cmd([[
|
|
|
|
au FileType clojure,clj,lisp,cl,l call rainbow#load()
|
|
|
|
let fts=['clojure', 'clj', 'lisp', 'lsp', 'cl', 'l']
|
|
|
|
if index(fts, &filetype) != -1
|
|
|
|
set ts=2
|
|
|
|
set sw=2
|
|
|
|
:RainbowToggle
|
|
|
|
endif
|
|
|
|
]])
|
2022-04-25 23:52:08 +02:00
|
|
|
require('lspconfig')['clojure_lsp'].setup{}
|
|
|
|
-- Go specific configurations
|
|
|
|
require('lspconfig')['gopls'].setup{}
|
|
|
|
-- C/C++ specific configurations
|
2022-04-26 04:39:37 +02:00
|
|
|
require('lspconfig')['clangd'].setup{}
|