Update init.lua
This commit is contained in:
parent
838408a5c6
commit
619865bb3c
1 changed files with 24 additions and 15 deletions
|
@ -18,7 +18,9 @@ plug('guns/vim-clojure-highlight', {['for'] = 'clojure'})
|
||||||
plug('guns/vim-clojure-static', {['for'] = 'clojure'})
|
plug('guns/vim-clojure-static', {['for'] = 'clojure'})
|
||||||
plug('luochen1990/rainbow', {['for'] = 'clojure'})
|
plug('luochen1990/rainbow', {['for'] = 'clojure'})
|
||||||
plug('docunext/closetag.vim')
|
plug('docunext/closetag.vim')
|
||||||
|
plug('norcalli/nvim_utils')
|
||||||
vim.call('plug#end')
|
vim.call('plug#end')
|
||||||
|
pcall(require, 'nvim_utils')
|
||||||
-- Basic editor configurations
|
-- Basic editor configurations
|
||||||
set.tabstop = 4
|
set.tabstop = 4
|
||||||
set.shiftwidth = 4
|
set.shiftwidth = 4
|
||||||
|
@ -31,28 +33,35 @@ set.autowrite = true
|
||||||
set.ai = true
|
set.ai = true
|
||||||
set.wildignore = {'*/cache/*', '*/tmp*'}
|
set.wildignore = {'*/cache/*', '*/tmp*'}
|
||||||
-- Keybindings
|
-- Keybindings
|
||||||
|
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
|
||||||
---- NERDTree
|
---- NERDTree
|
||||||
vim.keymap.set('n', '<S-w>', ':NERDTreeToggle')
|
nnoremap('n', '<S-w>', ':NERDTreeToggle<cr>')
|
||||||
vim.keymap.set('n', '<S-q>', ':NERDTreeClose')
|
nnoremap('n', '<S-q>', ':NERDTreeClose<cr>')
|
||||||
---- Ripgrep
|
---- Ripgrep
|
||||||
vim.keymap.set('n', '<C-f>', ':Rg')
|
nnoremap('n', '<C-f>', ':Rg<cr>')
|
||||||
-- Colors
|
-- Colors
|
||||||
vim.cmd('syntax enable')
|
vim.cmd('syntax enable')
|
||||||
vim.cmd('colorscheme melange')
|
vim.cmd('colorscheme melange')
|
||||||
vim.o.background = 'dark'
|
vim.o.background = 'dark'
|
||||||
-- Clojure specific configurations
|
-- 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
|
||||||
|
]])
|
||||||
require('lspconfig')['clojure_lsp'].setup{}
|
require('lspconfig')['clojure_lsp'].setup{}
|
||||||
local clj_augroup = vim.api.nvim_create_augroup('clj_cmds', {clear = true})
|
|
||||||
au('filetype', {
|
|
||||||
pattern = { 'clojure', 'clj' },
|
|
||||||
group = clj_augroup,
|
|
||||||
desc = 'Change tab size for clojure files',
|
|
||||||
callback = function()
|
|
||||||
set.tabstop = 2
|
|
||||||
set.shiftwidth = 2
|
|
||||||
set.softtabstop = 2
|
|
||||||
end
|
|
||||||
})
|
|
||||||
-- Go specific configurations
|
-- Go specific configurations
|
||||||
require('lspconfig')['gopls'].setup{}
|
require('lspconfig')['gopls'].setup{}
|
||||||
-- C/C++ specific configurations
|
-- C/C++ specific configurations
|
||||||
|
|
Loading…
Reference in a new issue