switched to lazy.nvim and clean up a bit
This commit is contained in:
1 parent
72bf7e727a
commit
11bb713b60
19 files changed
+290
-331
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
plugin
|
||||
lazy-lock.json
|
||||
@@ -1,9 +1,9 @@
|
||||
for _, name in ipairs({
|
||||
'reload',
|
||||
'settings',
|
||||
'mappings',
|
||||
'plugins',
|
||||
'neovide',
|
||||
'theme',
|
||||
'preview'
|
||||
}) do require('config.' .. name) end
|
||||
"reload",
|
||||
"settings",
|
||||
"mappings",
|
||||
"plugins",
|
||||
"neovide",
|
||||
"theme",
|
||||
"preview"
|
||||
}) do require("config." .. name) end
|
||||
+17
-17
@@ -1,35 +1,35 @@
|
||||
local on_attach = function(_, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.o.signcolumn = 'yes'
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
vim.o.signcolumn = "yes"
|
||||
|
||||
local map = function(from, to)
|
||||
vim.keymap.set('n', from, to,
|
||||
vim.keymap.set("n", from, to,
|
||||
{ noremap = true, silent = true, buffer = bufnr }
|
||||
)
|
||||
end
|
||||
|
||||
map('gd', vim.lsp.buf.definition)
|
||||
map('gr', vim.lsp.buf.references)
|
||||
map('gi', vim.lsp.buf.implementation)
|
||||
map('gD', vim.lsp.buf.declaration)
|
||||
map("gd", vim.lsp.buf.definition)
|
||||
map("gr", vim.lsp.buf.references)
|
||||
map("gi", vim.lsp.buf.implementation)
|
||||
map("gD", vim.lsp.buf.declaration)
|
||||
|
||||
map('K', vim.lsp.buf.hover)
|
||||
map('<C-k>', vim.lsp.buf.signature_help)
|
||||
map("K", vim.lsp.buf.hover)
|
||||
map("<C-k>", vim.lsp.buf.signature_help)
|
||||
|
||||
map('<leader>wa', vim.lsp.buf.add_workspace_folder)
|
||||
map('<leader>wr', vim.lsp.buf.remove_workspace_folder)
|
||||
map('<leader>wl', function()
|
||||
map("<leader>wa", vim.lsp.buf.add_workspace_folder)
|
||||
map("<leader>wr", vim.lsp.buf.remove_workspace_folder)
|
||||
map("<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end)
|
||||
map('<leader>D', vim.lsp.buf.type_definition)
|
||||
map('<leader>rn', vim.lsp.buf.rename)
|
||||
map('<leader>ca', vim.lsp.buf.code_action)
|
||||
map('<leader>fm', function()
|
||||
map("<leader>D", vim.lsp.buf.type_definition)
|
||||
map("<leader>rn", vim.lsp.buf.rename)
|
||||
map("<leader>ca", vim.lsp.buf.code_action)
|
||||
map("<leader>fm", function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end)
|
||||
end
|
||||
|
||||
local capabilities = require 'cmp_nvim_lsp'.default_capabilities(
|
||||
local capabilities = require "cmp_nvim_lsp".default_capabilities(
|
||||
vim.lsp.protocol.make_client_capabilities()
|
||||
)
|
||||
|
||||
|
||||
+37
-37
@@ -1,56 +1,56 @@
|
||||
local u = require 'config.utils'
|
||||
local u = require "config.utils"
|
||||
|
||||
-- terminal
|
||||
local m = u.mapping
|
||||
m.map('t', '<esc>', '<C-\\><C-n>')
|
||||
m.map('t', '<C-n>', '<C-\\><C-n><C-w>h')
|
||||
m.map('t', '<C-e>', '<C-\\><C-n><C-w>j')
|
||||
m.map('t', '<C-i>', '<C-\\><C-n><C-w>k')
|
||||
m.map('t', '<C-o>', '<C-\\><C-n><C-w>l')
|
||||
m.nmap('<leader>tm', '<cmd>belowright 7sp<cr><cmd>term<cr><cmd>setlocal nonu<cr>A')
|
||||
m.map("t", "<esc>", "<C-\\><C-n>")
|
||||
m.map("t", "<C-n>", "<C-\\><C-n><C-w>h")
|
||||
m.map("t", "<C-e>", "<C-\\><C-n><C-w>j")
|
||||
m.map("t", "<C-i>", "<C-\\><C-n><C-w>k")
|
||||
m.map("t", "<C-o>", "<C-\\><C-n><C-w>l")
|
||||
m.nmap("<leader>tm", "<cmd>belowright 7sp<cr><cmd>term<cr><cmd>setlocal nonu<cr>A")
|
||||
|
||||
-- off search highlight when escape is pressed
|
||||
m.nmap('<esc>', '<cmd>noh<cr><esc>')
|
||||
m.nmap("<esc>", "<cmd>noh<cr><esc>")
|
||||
|
||||
-- spell checking
|
||||
m.cmd('<leader>spl', 'setlocal spell spelllang=en_us')
|
||||
m.cmd('<leader>spL', 'setlocal nospell')
|
||||
m.cmd("<leader>spl", "setlocal spell spelllang=en_us")
|
||||
m.cmd("<leader>spL", "setlocal nospell")
|
||||
|
||||
-- lsp
|
||||
m.nmap('E', vim.diagnostic.open_float)
|
||||
m.nmap('[d', vim.diagnostic.goto_prev)
|
||||
m.nmap(']d', vim.diagnostic.goto_next)
|
||||
m.nmap('<leader>q', vim.diagnostic.setloclist)
|
||||
m.nmap("E", vim.diagnostic.open_float)
|
||||
m.nmap("[d", vim.diagnostic.goto_prev)
|
||||
m.nmap("]d", vim.diagnostic.goto_next)
|
||||
m.nmap("<leader>q", vim.diagnostic.setloclist)
|
||||
|
||||
-- colemak-dh
|
||||
local l = u.layout
|
||||
l.swap('n', 'h')
|
||||
l.swap('e', 'j')
|
||||
l.swap('i', 'k')
|
||||
l.swap('o', 'l')
|
||||
l.map('e','gj')
|
||||
l.map('i','gk')
|
||||
l.swap("n", "h")
|
||||
l.swap("e", "j")
|
||||
l.swap("i", "k")
|
||||
l.swap("o", "l")
|
||||
l.map("e","gj")
|
||||
l.map("i","gk")
|
||||
|
||||
l.swap('<C-w>n', '<C-w>h')
|
||||
l.swap('<C-w>e', '<C-w>j')
|
||||
l.swap('<C-w>i', '<C-w>k')
|
||||
l.swap('<C-w>o', '<C-w>l')
|
||||
l.swap('<C-w>N', '<C-w>H')
|
||||
l.swap('<C-w>E', '<C-w>J')
|
||||
l.swap('<C-w>I', '<C-w>K')
|
||||
l.swap('<C-w>O', '<C-w>L')
|
||||
l.swap("<C-w>n", "<C-w>h")
|
||||
l.swap("<C-w>e", "<C-w>j")
|
||||
l.swap("<C-w>i", "<C-w>k")
|
||||
l.swap("<C-w>o", "<C-w>l")
|
||||
l.swap("<C-w>N", "<C-w>H")
|
||||
l.swap("<C-w>E", "<C-w>J")
|
||||
l.swap("<C-w>I", "<C-w>K")
|
||||
l.swap("<C-w>O", "<C-w>L")
|
||||
|
||||
l.swap('N', 'H')
|
||||
l.swap('O', 'L')
|
||||
l.swap("N", "H")
|
||||
l.swap("O", "L")
|
||||
|
||||
l.map('<C-n>', '<C-w>h')
|
||||
l.map('<C-e>', '<C-w>j')
|
||||
l.map('<C-i>', '<C-w>k')
|
||||
l.map('<C-o>', '<C-w>l')
|
||||
l.map("<C-n>", "<C-w>h")
|
||||
l.map("<C-e>", "<C-w>j")
|
||||
l.map("<C-i>", "<C-w>k")
|
||||
l.map("<C-o>", "<C-w>l")
|
||||
|
||||
l.map('<C-,>', '<cmd>vert res -1<CR>')
|
||||
l.map('<C-.>', '<cmd>vert res +1<CR>')
|
||||
l.map("<C-,>", "<cmd>vert res -1<CR>")
|
||||
l.map("<C-.>", "<cmd>vert res +1<CR>")
|
||||
|
||||
-- ascension
|
||||
m.map('x','<leader>p', '\"_dp')
|
||||
m.map("x","<leader>p", "\"_dp")
|
||||
|
||||
+12
-23
@@ -1,26 +1,15 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- bootstrap
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
PACKER_BOOTSTRAP = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local packer = require('packer')
|
||||
packer.startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- plugin categories
|
||||
require 'config.plugins.telescope'(use)
|
||||
require 'config.plugins.tree'(use)
|
||||
require 'config.plugins.cmp'(use)
|
||||
require 'config.plugins.lsp'(use)
|
||||
require 'config.plugins.visual'(use)
|
||||
require 'config.plugins.util'(use)
|
||||
|
||||
-- sync if bootstrapped
|
||||
if PACKER_BOOTSTRAP then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
require("lazy").setup("plugins")
|
||||
@@ -1,36 +0,0 @@
|
||||
return function(use)
|
||||
use 'hrsh7th/cmp-nvim-lsp'
|
||||
use 'hrsh7th/cmp-buffer'
|
||||
use 'hrsh7th/cmp-path'
|
||||
use 'hrsh7th/cmp-cmdline'
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = function()
|
||||
local cmp = require 'cmp'
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<c-space>'] = cmp.mapping.complete(),
|
||||
['<c-e>'] = cmp.mapping.abort(),
|
||||
['<cr>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<tab>'] = cmp.mapping.select_next_item(),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
{ name = 'neorg' },
|
||||
}),
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
use 'L3MON4D3/LuaSnip'
|
||||
use 'saadparwaiz1/cmp_luasnip'
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
return function(use)
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.0',
|
||||
requires = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
require 'telescope'.setup {}
|
||||
|
||||
local u = require 'config.utils'.mapping
|
||||
|
||||
u.cmd('<leader>ff', 'Telescope find_files')
|
||||
u.cmd('<leader>fg', 'Telescope live_grep')
|
||||
u.cmd('<leader>fb', 'Telescope buffers')
|
||||
u.cmd('<leader>fh', 'Telescope help_tags')
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
run = 'make',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
-- doesn't work?
|
||||
-- config = function() require 'telescope'.load_extension('fzf') end
|
||||
}
|
||||
use {
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function() require 'telescope'.load_extension('ui-select') end
|
||||
}
|
||||
use({
|
||||
'ziontee113/icon-picker.nvim',
|
||||
requires = { 'stevearc/dressing.nvim' },
|
||||
config = function()
|
||||
require('icon-picker').setup {}
|
||||
local u = require 'config.utils'.mapping
|
||||
u.cmd('<leader>fi', 'IconPickerYank alt_font symbols nerd_font emoji')
|
||||
vim.keymap.set('i', '<c-s>', '<cmd>IconPickerInsert alt_font symbols nerd_font emoji<cr>')
|
||||
end,
|
||||
})
|
||||
end
|
||||
@@ -1,62 +0,0 @@
|
||||
return function(use)
|
||||
use {
|
||||
'navarasu/onedark.nvim',
|
||||
config = function()
|
||||
require 'onedark'.setup { style = 'darker' }
|
||||
require 'onedark'.load()
|
||||
package.loaded['config.theme'] = nil
|
||||
require 'config.theme'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
config = function()
|
||||
if vim.o.termguicolors then
|
||||
require 'colorizer'.setup()
|
||||
end
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
||||
config = function()
|
||||
require 'lualine'.setup {}
|
||||
-- refresh bar when cursor moved to update line & col
|
||||
local cb = function()
|
||||
require 'lualine'.refresh {
|
||||
scope = 'window',
|
||||
place = { 'statusline' },
|
||||
}
|
||||
end
|
||||
--[[local group = vim.api.nvim_create_augroup('lualine', {})
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
group = group,
|
||||
callback = cb
|
||||
})]]
|
||||
end
|
||||
}
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function() require 'gitsigns'.setup() end
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
require 'nvim-treesitter.install'.update {
|
||||
with_sync = true
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = {"norg"},
|
||||
highlight = { enable = true }
|
||||
}
|
||||
end,
|
||||
}
|
||||
use {
|
||||
'elkowar/yuck.vim'
|
||||
}
|
||||
use {
|
||||
'kmonad/kmonad-vim'
|
||||
}
|
||||
end
|
||||
@@ -1,17 +1,15 @@
|
||||
local u = require 'config.utils'
|
||||
local g = vim.api.nvim_create_augroup("preview", {})
|
||||
|
||||
local g = vim.api.nvim_create_augroup('preview', {})
|
||||
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
group = g,
|
||||
pattern = '*.tex',
|
||||
pattern = "*.tex",
|
||||
callback = function(arg)
|
||||
local dir = arg.file:match('.*/')
|
||||
local args = ''
|
||||
local dir = arg.file:match(".*/")
|
||||
local args = ""
|
||||
if dir ~= nil then
|
||||
args = '-output-directory=\''..dir..'\' '
|
||||
args = "-output-directory='"..dir.."' "
|
||||
end
|
||||
vim.cmd('silent exec "!pdflatex '..args..'\''..arg.file..'\'"')
|
||||
vim.cmd("silent exec \"!pdflatex "..args.."'"..arg.file.."'\"")
|
||||
end
|
||||
})
|
||||
|
||||
+10
-20
@@ -1,28 +1,18 @@
|
||||
local u = require 'config.utils'.load
|
||||
local u = require "config.utils".load
|
||||
|
||||
local g = vim.api.nvim_create_augroup('reload', {})
|
||||
local g = vim.api.nvim_create_augroup("reload", {})
|
||||
|
||||
-- reload these files when written to
|
||||
|
||||
for _, mod in ipairs({
|
||||
'reload',
|
||||
'settings',
|
||||
'mappings',
|
||||
'utils',
|
||||
'neovide',
|
||||
'theme',
|
||||
'preview',
|
||||
}) do u.mod_post_write(g, 'config.' .. mod, u.reload) end
|
||||
"reload",
|
||||
"settings",
|
||||
"mappings",
|
||||
"utils",
|
||||
"neovide",
|
||||
"theme",
|
||||
"preview",
|
||||
}) do u.mod_post_write(g, "config." .. mod, u.reload) end
|
||||
|
||||
-- reload plugin files when written to
|
||||
|
||||
u.mod_post_write(g, 'config.plugins', function(mod)
|
||||
u.reload(mod)
|
||||
require 'packer'.compile()
|
||||
end)
|
||||
u.mod_post_write(g, 'config.plugins.*', function(mod)
|
||||
print(mod)
|
||||
u.unload(mod)
|
||||
u.reload('config.plugins')
|
||||
require 'packer'.compile()
|
||||
end)
|
||||
@@ -5,19 +5,19 @@ local g = vim.g
|
||||
o.number = true
|
||||
o.relativenumber = true
|
||||
o.showmode = false
|
||||
o.clipboard = 'unnamedplus'
|
||||
o.clipboard = "unnamedplus"
|
||||
|
||||
g.mapleader = ' '
|
||||
vim.cmd('filetype plugin on')
|
||||
vim.cmd('syntax on')
|
||||
g.mapleader = " "
|
||||
vim.cmd("filetype plugin on")
|
||||
vim.cmd("syntax on")
|
||||
|
||||
-- line break (wrapping) settings
|
||||
o.linebreak = true
|
||||
o.breakindent = true
|
||||
o.showbreak = '\\ '
|
||||
o.showbreak = "\\ "
|
||||
|
||||
-- lines after end of file empty instead of ~ (fillchars)
|
||||
o.fcs = 'eob: '
|
||||
o.fcs = "eob: "
|
||||
|
||||
-- tab
|
||||
o.expandtab = true
|
||||
@@ -25,7 +25,7 @@ o.softtabstop = 4
|
||||
o.shiftwidth = 4
|
||||
|
||||
-- turn of gui colors if in tty
|
||||
if os.getenv('TERM') ~= 'linux' then
|
||||
if os.getenv("TERM") ~= "linux" then
|
||||
o.termguicolors = true
|
||||
else
|
||||
o.termguicolors = false
|
||||
@@ -39,6 +39,5 @@ for type, icon in pairs(signs) do
|
||||
end
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = { prefix = '●' };
|
||||
virtual_text = { prefix = "●" },
|
||||
})
|
||||
|
||||
@@ -6,14 +6,14 @@ local gbhl = function(name, color)
|
||||
end
|
||||
|
||||
-- highlight extra white space with red
|
||||
hl('ExtraWhitespace', { ctermbg = 'red', bg = '#ff8888' })
|
||||
hl("ExtraWhitespace", { ctermbg = "red", bg = "#ff8888" })
|
||||
vim.cmd [[match ExtraWhitespace /\s\+$/]]
|
||||
|
||||
-- make background transparent
|
||||
gbhl('Normal', 'none')
|
||||
gbhl('EndOfBuffer', 'none')
|
||||
gbhl('SignColumn', 'none')
|
||||
gbhl('NeoTreeNormal', 'none')
|
||||
gbhl('NeoTreeNormalNC', 'none')
|
||||
gbhl('NeoTreeEndOfBuffer', 'none')
|
||||
gbhl("Normal", "none")
|
||||
gbhl("EndOfBuffer", "none")
|
||||
gbhl("SignColumn", "none")
|
||||
gbhl("NeoTreeNormal", "none")
|
||||
gbhl("NeoTreeNormalNC", "none")
|
||||
gbhl("NeoTreeEndOfBuffer", "none")
|
||||
|
||||
@@ -3,16 +3,16 @@ local opts = { noremap = true, silent = true }
|
||||
-- mapping
|
||||
local mapping = {}
|
||||
mapping.map = function(mode, from, to) vim.keymap.set(mode, from, to, opts) end
|
||||
mapping.nmap = function(from, to) vim.keymap.set('n', from, to, opts) end
|
||||
mapping.nmap = function(from, to) vim.keymap.set("n", from, to, opts) end
|
||||
mapping.cmd = function(from, content)
|
||||
vim.keymap.set('n', from, '<cmd>' .. content .. '<cr>', opts)
|
||||
vim.keymap.set("n", from, "<cmd>" .. content .. "<cr>", opts)
|
||||
end
|
||||
|
||||
-- layout (mapping)
|
||||
local layout = {}
|
||||
layout.map = function(from, to)
|
||||
vim.keymap.set('n', from, to, opts)
|
||||
vim.keymap.set('x', from, to, opts)
|
||||
vim.keymap.set("n", from, to, opts)
|
||||
vim.keymap.set("x", from, to, opts)
|
||||
end
|
||||
layout.swap = function(a, b)
|
||||
layout.map(a, b)
|
||||
@@ -22,10 +22,10 @@ mapping.layout = layout
|
||||
|
||||
-- loading stuff
|
||||
local load = {}
|
||||
load.lua_path = vim.fn.stdpath('config') .. '/lua/'
|
||||
load.lua_path = vim.fn.stdpath("config") .. "/lua/"
|
||||
|
||||
load.post_write = function(group, path, fn)
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
group = group,
|
||||
pattern = load.lua_path .. path,
|
||||
callback = fn,
|
||||
@@ -33,12 +33,12 @@ load.post_write = function(group, path, fn)
|
||||
end
|
||||
load.mod_post_write = function(group, mod, fn)
|
||||
local set_name = false
|
||||
if mod:sub(-1, -1) == '*' then set_name = true end
|
||||
local path = mod:gsub('[.]', '/') .. '.lua'
|
||||
if mod:sub(-1, -1) == "*" then set_name = true end
|
||||
local path = mod:gsub("[.]", "/") .. ".lua"
|
||||
load.post_write(group, path, function(arg)
|
||||
local m = mod
|
||||
if set_name then
|
||||
local name = arg.file:match('.*/(.*).lua')
|
||||
local name = arg.file:match(".*/(.*).lua")
|
||||
m = mod:sub(0, -2) .. name
|
||||
end
|
||||
fn(m, arg)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
local config = function()
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs( -4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<c-space>"] = cmp.mapping.complete(),
|
||||
["<c-e>"] = cmp.mapping.abort(),
|
||||
["<cr>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<tab>"] = cmp.mapping.select_next_item(),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
{ name = "neorg" },
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = config,
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
}
|
||||
},
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
local config = function()
|
||||
local settings = require 'config.lsp-settings'
|
||||
local settings = require("config.lsp-settings")
|
||||
local on_attach = settings.on_attach
|
||||
local capabilities = settings.capabilities
|
||||
|
||||
require 'lspconfig'.lua_ls.setup {
|
||||
require("lspconfig").lua_ls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
@@ -22,57 +22,64 @@ local config = function()
|
||||
},
|
||||
}
|
||||
|
||||
require 'rust-tools'.setup {
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.markdown_fenced_languages = {
|
||||
"ts=typescript"
|
||||
}
|
||||
require 'lspconfig'.denols.setup {
|
||||
require("lspconfig").denols.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
require 'lspconfig'.clangd.setup {
|
||||
require("lspconfig").clangd.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
require 'lspconfig'.asm_lsp.setup {
|
||||
require("lspconfig").asm_lsp.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
require 'lspconfig'.pylsp.setup {
|
||||
require("lspconfig").pylsp.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
require'lspconfig'.kotlin_language_server.setup {
|
||||
require("lspconfig").kotlin_language_server.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
end
|
||||
|
||||
return function(use)
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
config = config
|
||||
}
|
||||
use {
|
||||
'simrat39/rust-tools.nvim',
|
||||
requires = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'mfussenegger/nvim-dap',
|
||||
local rs_config = function()
|
||||
local settings = require "config.lsp-settings"
|
||||
local on_attach = settings.on_attach
|
||||
local capabilities = settings.capabilities
|
||||
require "rust-tools".setup {
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
}
|
||||
use {
|
||||
'windwp/nvim-autopairs',
|
||||
config = function() require 'nvim-autopairs'.setup {} end
|
||||
}
|
||||
use {
|
||||
'scalameta/nvim-metals',
|
||||
requires = { "nvim-lua/plenary.nvim" }
|
||||
}
|
||||
use 'mfussenegger/nvim-jdtls'
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = config
|
||||
},
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
rs_config = rs_config
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
config = function() require "nvim-autopairs".setup {} end
|
||||
},
|
||||
{
|
||||
"scalameta/nvim-metals",
|
||||
dependencies = { "nvim-lua/plenary.nvim" }
|
||||
},
|
||||
"mfussenegger/nvim-jdtls",
|
||||
"folke/neodev.nvim"
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.0",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("telescope").setup {}
|
||||
|
||||
local u = require("config.utils").mapping
|
||||
|
||||
u.cmd("<leader>ff", "Telescope find_files")
|
||||
u.cmd("<leader>fg", "Telescope live_grep")
|
||||
u.cmd("<leader>fb", "Telescope buffers")
|
||||
u.cmd("<leader>fh", "Telescope help_tags")
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||
config = function() require("telescope").load_extension("fzf") end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||
config = function() require("telescope").load_extension("ui-select") end
|
||||
},
|
||||
{
|
||||
"ziontee113/icon-picker.nvim",
|
||||
dependencies = { "stevearc/dressing.nvim" },
|
||||
config = function()
|
||||
require("icon-picker").setup {}
|
||||
local u = require("config.utils").mapping
|
||||
u.cmd("<leader>fi", "IconPickerYank alt_font symbols nerd_font emoji")
|
||||
vim.keymap.set("i", "<c-s>", "<cmd>IconPickerInsert alt_font symbols nerd_font emoji<cr>")
|
||||
end,
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
return function(use)
|
||||
use {
|
||||
return {
|
||||
{
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
branch = "v2.x",
|
||||
requires = {
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim'
|
||||
},
|
||||
config = function()
|
||||
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
|
||||
require 'neo-tree'.setup {
|
||||
require('neo-tree').setup {
|
||||
close_if_last_window = true,
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
@@ -29,4 +29,4 @@ return function(use)
|
||||
u.cmd('<leader>e', 'Neotree toggle')
|
||||
end
|
||||
}
|
||||
end
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
return function(use)
|
||||
use {
|
||||
return {
|
||||
{
|
||||
'nvim-neorg/neorg',
|
||||
tag = '0.0.12',
|
||||
config = function()
|
||||
@@ -16,16 +16,6 @@ return function(use)
|
||||
}
|
||||
}
|
||||
end,
|
||||
requires = 'nvim-lua/plenary.nvim'
|
||||
}
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = function() vim.fn["mkdp#util#install"]() end,
|
||||
})
|
||||
vim.cmd([[
|
||||
function! OpenMarkdownPreview (url)
|
||||
execute "silent ! firefox --new-window " . a:url
|
||||
endfunction
|
||||
let g:mkdp_browserfunc = 'OpenMarkdownPreview'
|
||||
]])
|
||||
end
|
||||
dependencies = 'nvim-lua/plenary.nvim'
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
{
|
||||
"navarasu/onedark.nvim",
|
||||
config = function()
|
||||
require("onedark").setup { style = "darker" }
|
||||
require("onedark").load()
|
||||
package.loaded["config.theme"] = nil
|
||||
require("config.theme")
|
||||
end
|
||||
},
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
if vim.o.termguicolors then
|
||||
require("colorizer").setup()
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup {}
|
||||
end
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function() require("gitsigns").setup() end
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = function()
|
||||
require("nvim-treesitter.install").update {
|
||||
with_sync = true
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = { "norg" },
|
||||
highlight = { enable = true }
|
||||
}
|
||||
end,
|
||||
},
|
||||
"elkowar/yuck.vim",
|
||||
"kmonad/kmonad-vim"
|
||||
}
|
||||
Reference in new issue
Block a user