A shit ton of stuff
This commit is contained in:
parent
7cbe73ad5b
commit
c01ce48abe
20 changed files with 338 additions and 288 deletions
dotfiles/neovim/lua/my
|
@ -5,36 +5,38 @@ local au = require("my.helpers.augroup")
|
|||
local M = {}
|
||||
|
||||
function M.map(mode, lhs, rhs, opts)
|
||||
if string.len(mode) > 1 then
|
||||
for i = 1, #mode do
|
||||
local c = mode:sub(i, i)
|
||||
M.map(c, lhs, rhs, opts)
|
||||
end
|
||||
else
|
||||
local options = helpers.mergeTables(opts, {noremap = true})
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
if string.len(mode) > 1 then
|
||||
for i = 1, #mode do
|
||||
local c = mode:sub(i, i)
|
||||
M.map(c, lhs, rhs, opts)
|
||||
end
|
||||
else
|
||||
local options = helpers.mergeTables(opts, { noremap = true })
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
end
|
||||
end
|
||||
|
||||
function M.mapSilent(mode, lhs, rhs, opts)
|
||||
local options = helpers.mergeTables(opts, {silent = true})
|
||||
M.map(mode, lhs, rhs, options)
|
||||
local options = helpers.mergeTables(opts, { silent = true })
|
||||
M.map(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
M.map("n", "qq", ":wq<cr>") -- Create vertical split
|
||||
M.map("n", "qq", ":wq<cr>") -- Create vertical split
|
||||
|
||||
-- Create chords
|
||||
if arpeggio ~= nil then
|
||||
arpeggio.chord("n", "vs", "<C-w>v") -- Create vertical split
|
||||
arpeggio.chord("n", "ji", ":w<cr>") -- Saving
|
||||
arpeggio.chord("i", "jk", "<Esc>") -- Remap Esc to jk
|
||||
arpeggio.chord("i", "<Leader>k", "<C-k><cr>") -- Rebind digraph insertion to leader+k
|
||||
arpeggio.chord("inv", "<Leader>a", "<C-6><cr>") -- Rebind switching to the last pane using leader+a
|
||||
arpeggio.chord("nv", "cp", "\"+") -- Press cp to use the global clipboard
|
||||
end
|
||||
-- Create chords
|
||||
if arpeggio ~= nil then
|
||||
arpeggio.chord("n", "vs", "<C-w>v") -- Create vertical split
|
||||
arpeggio.chord("n", "ji", ":w<cr>") -- Saving
|
||||
arpeggio.chord("i", "jk", "<Esc>") -- Remap Esc to jk
|
||||
arpeggio.chord("i", "<Leader>k", "<C-k><cr>") -- Rebind digraph insertion to leader+k
|
||||
arpeggio.chord("inv", "<Leader>a", "<C-6><cr>") -- Rebind switching to the last pane using leader+a
|
||||
arpeggio.chord("inv", "<Leader>a", "<C-6><cr>") -- Rebind switching to the last pane using leader+a
|
||||
arpeggio.chord("nv", "cp", "\"+") -- Press cp to use the global clipboard
|
||||
arpeggio.chord("n", "rw", ":%s/<C-r><C-w>/") -- Press rt to rename word under cursor
|
||||
end
|
||||
|
||||
return M
|
||||
return M
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,52 +1,54 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
local paq = require("paq")
|
||||
local themePackages = require("my.theme").deps
|
||||
local base = {
|
||||
"neovim/nvim-lspconfig", -- configures lsps for me
|
||||
"windwp/nvim-autopairs", -- closes pairs for me (should look for a better one)
|
||||
"nvim-lua/plenary.nvim", -- async utility lib it seems?
|
||||
"nvim-telescope/telescope.nvim", -- fuzzy search for say opening files
|
||||
"purescript-contrib/purescript-vim", -- purescript support
|
||||
"terrortylor/nvim-comment", -- allows toggling line comments
|
||||
{"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}, -- use treesitter for syntax highlighting
|
||||
{"nvim-treesitter/nvim-treesitter-textobjects", run = ":TSUpdate"}, -- the lean plugin wants me to install this, lol
|
||||
"startup-nvim/startup.nvim", -- splash screen
|
||||
"kyazdani42/nvim-web-devicons", -- nice looking icons
|
||||
"nvim-lualine/lualine.nvim", -- customizable status line
|
||||
"kyazdani42/nvim-tree.lua", -- file tree
|
||||
"lervag/vimtex", -- latex support
|
||||
"jose-elias-alvarez/null-ls.nvim", -- generic language server
|
||||
"nvim-telescope/telescope-file-browser.nvim", -- file creation/deletion menu
|
||||
"onsails/lspkind.nvim", -- show icons in lsp completion menus
|
||||
"preservim/vimux", -- interact with tmux from within vim
|
||||
"christoomey/vim-tmux-navigator", -- easly switch between tmux and vim panes
|
||||
"kana/vim-arpeggio", -- chord support, let"s fucking goooo
|
||||
{"andweeb/presence.nvim", run = ":DownloadUnicode"}, -- discord rich presence
|
||||
"Julian/lean.nvim", -- lean support
|
||||
"kmonad/kmonad-vim", -- kmonad config support
|
||||
-- "LucHermitte/lh-vim-lib", -- dependency for lh-brackets
|
||||
-- "LucHermitte/lh-brackets", -- kinda useless bruh, should find something better
|
||||
-- Cmp related stuff
|
||||
"hrsh7th/cmp-nvim-lsp", -- lsp completion
|
||||
"hrsh7th/cmp-buffer", -- idr what this is
|
||||
"hrsh7th/cmp-path", -- path completion ig?
|
||||
"hrsh7th/cmp-cmdline", -- cmdline completion perhaps?
|
||||
"hrsh7th/nvim-cmp", -- completion engine
|
||||
"L3MON4D3/LuaSnip", -- snippeting engine
|
||||
"saadparwaiz1/cmp_luasnip", -- snippet support for cmp
|
||||
"wakatime/vim-wakatime", -- track time usage
|
||||
"vmchale/dhall-vim", -- dhall syntax highlighting
|
||||
"folke/which-key.nvim"
|
||||
}
|
||||
local paq = require("paq")
|
||||
local themePackages = require("my.theme").deps
|
||||
local base = {
|
||||
"neovim/nvim-lspconfig", -- configures lsps for me
|
||||
"windwp/nvim-autopairs", -- closes pairs for me (should look for a better one)
|
||||
"nvim-lua/plenary.nvim", -- async utility lib it seems?
|
||||
"nvim-telescope/telescope.nvim", -- fuzzy search for say opening files
|
||||
"purescript-contrib/purescript-vim", -- purescript support
|
||||
"terrortylor/nvim-comment", -- allows toggling line comments
|
||||
-- This gets installed by nix now!
|
||||
-- {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}, -- use treesitter for syntax highlighting
|
||||
"nvim-treesitter/nvim-treesitter-textobjects", -- the lean plugin wants me to install this, lol
|
||||
-- "startup-nvim/startup.nvim", -- splash screen
|
||||
"glepnir/dashboard-nvim", -- similar to startup.nvim
|
||||
"kyazdani42/nvim-web-devicons", -- nice looking icons
|
||||
"nvim-lualine/lualine.nvim", -- customizable status line
|
||||
"kyazdani42/nvim-tree.lua", -- file tree
|
||||
"lervag/vimtex", -- latex support
|
||||
"jose-elias-alvarez/null-ls.nvim", -- generic language server
|
||||
"nvim-telescope/telescope-file-browser.nvim", -- file creation/deletion menu
|
||||
"onsails/lspkind.nvim", -- show icons in lsp completion menus
|
||||
"preservim/vimux", -- interact with tmux from within vim
|
||||
"christoomey/vim-tmux-navigator", -- easly switch between tmux and vim panes
|
||||
"kana/vim-arpeggio", -- chord support, let"s fucking goooo
|
||||
{ "andweeb/presence.nvim", run = ":DownloadUnicode" }, -- discord rich presence
|
||||
"Julian/lean.nvim", -- lean support
|
||||
"kmonad/kmonad-vim", -- kmonad config support
|
||||
-- "LucHermitte/lh-vim-lib", -- dependency for lh-brackets
|
||||
-- "LucHermitte/lh-brackets", -- kinda useless bruh, should find something better
|
||||
-- Cmp related stuff
|
||||
"hrsh7th/cmp-nvim-lsp", -- lsp completion
|
||||
"hrsh7th/cmp-buffer", -- idr what this is
|
||||
"hrsh7th/cmp-path", -- path completion ig?
|
||||
"hrsh7th/cmp-cmdline", -- cmdline completion perhaps?
|
||||
"hrsh7th/nvim-cmp", -- completion engine
|
||||
"L3MON4D3/LuaSnip", -- snippeting engine
|
||||
"saadparwaiz1/cmp_luasnip", -- snippet support for cmp
|
||||
"wakatime/vim-wakatime", -- track time usage
|
||||
"vmchale/dhall-vim", -- dhall syntax highlighting
|
||||
"folke/which-key.nvim"
|
||||
}
|
||||
|
||||
for _, v in ipairs(themePackages) do
|
||||
-- append package in the base list
|
||||
table.insert(base, v)
|
||||
end
|
||||
for _, v in ipairs(themePackages) do
|
||||
-- append package in the base list
|
||||
table.insert(base, v)
|
||||
end
|
||||
|
||||
paq(base)
|
||||
paq(base)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
local A = require("my.helpers.augroup")
|
||||
local M = {}
|
||||
|
||||
local extraCommentStrings = {nix = "# %s", lean = "/- %s -/", bkf = "-- %s"}
|
||||
local extraCommentStrings = { lean = "/- %s -/", bkf = "-- %s" }
|
||||
|
||||
-- Update comments for certain languages
|
||||
local function setCommentString(extension, commentString)
|
||||
A.augroup('set-commentstring-' .. extension, function()
|
||||
local action =
|
||||
':lua vim.api.nvim_buf_set_option(0, "commentstring", "' ..
|
||||
commentString .. '")'
|
||||
function M.setCommentString(extension, commentString)
|
||||
A.augroup('set-commentstring-' .. extension, function()
|
||||
local action =
|
||||
':lua vim.api.nvim_buf_set_option(0, "commentstring", "' ..
|
||||
commentString .. '")'
|
||||
|
||||
A.autocmd('BufEnter', '*.' .. extension, action)
|
||||
A.autocmd('BufFilePost', '*.' .. extension, action)
|
||||
end)
|
||||
A.autocmd('BufEnter', '*.' .. extension, action)
|
||||
A.autocmd('BufFilePost', '*.' .. extension, action)
|
||||
end)
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
require('nvim_comment').setup()
|
||||
require('nvim_comment').setup()
|
||||
|
||||
for lang, commentString in pairs(extraCommentStrings) do
|
||||
setCommentString(lang, commentString)
|
||||
end
|
||||
for lang, commentString in pairs(extraCommentStrings) do
|
||||
M.setCommentString(lang, commentString)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
32
dotfiles/neovim/lua/my/plugins/dashboard.lua
Normal file
32
dotfiles/neovim/lua/my/plugins/dashboard.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
local db = require("dashboard")
|
||||
-- db.custom_header = {
|
||||
-- "", "",
|
||||
-- [[ /\ \ /\ \ /\ \ /\ \ /\ \ ]],
|
||||
-- [[ /::\____\ /::\ \ /::\ \ /::\ \ /::\ \ ]],
|
||||
-- [[ /:::/ / /::::\ \ \:::\ \ /::::\ \ /::::\ \ ]],
|
||||
-- [[ /:::/ _/___ /::::::\ \ \:::\ \ /::::::\ \ /::::::\ \ ]],
|
||||
-- [[ /:::/ /\ \ /:::/\:::\ \ \:::\ \ /:::/\:::\ \ /:::/\:::\ \ ]],
|
||||
-- [[ /:::/ /::\____\ /:::/__\:::\ \ \:::\ \ /:::/__\:::\ \ /:::/__\:::\ \ ]],
|
||||
-- [[ /:::/ /:::/ / /::::\ \:::\ \ /::::\ \ /::::\ \:::\ \ /::::\ \:::\ \ ]],
|
||||
-- [[ /:::/ /:::/ _/___ /::::::\ \:::\ \ /::::::\ \ /::::::\ \:::\ \ /::::::\ \:::\ \ ]],
|
||||
-- [[ /:::/___/:::/ /\ \ /:::/\:::\ \:::\ \ /:::/\:::\ \ /:::/\:::\ \:::\ \ /:::/\:::\ \:::\____\ ]],
|
||||
-- [[|:::| /:::/ /::\____\/:::/ \:::\ \:::\____\ /:::/ \:::\____\/:::/__\:::\ \:::\____\/:::/ \:::\ \:::| |]],
|
||||
-- [[|:::|__/:::/ /:::/ /\::/ \:::\ /:::/ / /:::/ \::/ /\:::\ \:::\ \::/ /\::/ |::::\ /:::|____|]],
|
||||
-- [[ \:::\/:::/ /:::/ / \/____/ \:::\/:::/ / /:::/ / \/____/ \:::\ \:::\ \/____/ \/____|:::::\/:::/ / ]],
|
||||
-- [[ \::::::/ /:::/ / \::::::/ / /:::/ / \:::\ \:::\ \ |:::::::::/ / ]],
|
||||
-- [[ \::::/___/:::/ / \::::/ / /:::/ / \:::\ \:::\____\ |::|\::::/ / ]],
|
||||
-- [[ \:::\__/:::/ / /:::/ / \::/ / \:::\ \::/ / |::| \::/____/ ]],
|
||||
-- [[ \::::::::/ / /:::/ / \/____/ \:::\ \/____/ |::| ~| ]],
|
||||
-- [[ \::::::/ / /:::/ / \:::\ \ |::| | ]],
|
||||
-- [[ \::::/ / /:::/ / \:::\____\ \::| | ]],
|
||||
-- [[ \::/____/ \::/ / \::/ / \:| | ]],
|
||||
-- [[ ~~ \/____/ \/____/ \|___| ]],
|
||||
-- ""
|
||||
-- }
|
||||
|
||||
end
|
||||
|
||||
return M
|
|
@ -1,29 +1,30 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
-- Other unconfigured plugins
|
||||
require('nvim-autopairs').setup()
|
||||
require("startup").setup()
|
||||
require("presence"):setup({}) -- wtf does the : do here?
|
||||
-- require("which-key").setup()
|
||||
-- Other unconfigured plugins
|
||||
require('nvim-autopairs').setup()
|
||||
-- require("startup").setup()
|
||||
require("presence"):setup({}) -- wtf does the : do here?
|
||||
-- require("which-key").setup()
|
||||
|
||||
-- Plugins with their own configs:
|
||||
require("my.plugins.vim-tmux-navigator").setup()
|
||||
-- require("my.plugins.fzf-lua").setup()
|
||||
-- require("my.plugins.nerdtree").setup()
|
||||
require("my.plugins.treesitter").setup()
|
||||
require("my.plugins.cmp").setup()
|
||||
require("my.plugins.lspconfig").setup()
|
||||
require("my.plugins.null-ls").setup()
|
||||
require("my.plugins.lualine").setup()
|
||||
require("my.plugins.comment").setup()
|
||||
require("my.plugins.nvim-tree").setup()
|
||||
require("my.plugins.vimtex").setup()
|
||||
require("my.plugins.telescope").setup()
|
||||
require("my.plugins.vimux").setup()
|
||||
-- require("my.plugins.idris").setup()
|
||||
-- require("my.plugins.lh-brackets").setup()
|
||||
require("my.plugins.lean").setup()
|
||||
-- Plugins with their own configs:
|
||||
require("my.plugins.vim-tmux-navigator").setup()
|
||||
-- require("my.plugins.fzf-lua").setup()
|
||||
-- require("my.plugins.nerdtree").setup()
|
||||
require("my.plugins.treesitter").setup()
|
||||
require("my.plugins.dashboard").setup()
|
||||
require("my.plugins.cmp").setup()
|
||||
require("my.plugins.lspconfig").setup()
|
||||
require("my.plugins.null-ls").setup()
|
||||
require("my.plugins.lualine").setup()
|
||||
require("my.plugins.comment").setup()
|
||||
require("my.plugins.nvim-tree").setup()
|
||||
require("my.plugins.vimtex").setup()
|
||||
require("my.plugins.telescope").setup()
|
||||
require("my.plugins.vimux").setup()
|
||||
-- require("my.plugins.idris").setup()
|
||||
-- require("my.plugins.lh-brackets").setup()
|
||||
require("my.plugins.lean").setup()
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,143 +1,133 @@
|
|||
local A = require("my.plugins.arpeggio")
|
||||
|
||||
local M = {}
|
||||
|
||||
local function map(buf, mode, lhs, rhs, opts)
|
||||
|
||||
local options = {noremap = true, silent = true}
|
||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
vim.api.nvim_buf_set_keymap(buf, mode, lhs, rhs, options)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
vim.api.nvim_buf_set_keymap(buf, mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
function M.on_attach(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
print("Initializing formatter...")
|
||||
vim.cmd([[
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
print("Initializing formatter...")
|
||||
vim.cmd([[
|
||||
augroup LspFormatting
|
||||
autocmd! * <buffer>
|
||||
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
||||
augroup END
|
||||
]])
|
||||
end
|
||||
end
|
||||
|
||||
print("Setting up keybinds...")
|
||||
-- Go to declaration / definition / implementation
|
||||
map(bufnr, "n", 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>')
|
||||
map(bufnr, "n", 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>')
|
||||
map(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>')
|
||||
print("Setting up keybinds...")
|
||||
-- Go to declaration / definition / implementation
|
||||
map(bufnr, "n", 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>')
|
||||
map(bufnr, "n", 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>')
|
||||
map(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>')
|
||||
|
||||
-- Hover
|
||||
map(bufnr, 'n', 'J', "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
map(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>')
|
||||
map(bufnr, 'n', 'L', '<cmd>lua vim.lsp.buf.signature_help()<CR>')
|
||||
-- Hover
|
||||
map(bufnr, 'n', 'J', "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
map(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>')
|
||||
map(bufnr, 'n', 'L', '<cmd>lua vim.lsp.buf.signature_help()<CR>')
|
||||
|
||||
-- Workspace stuff
|
||||
-- map(bufnr, 'n', '<leader>wa',
|
||||
-- '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>')
|
||||
-- map(bufnr, 'n', '<leader>wr',
|
||||
-- '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>')
|
||||
-- map(bufnr, 'n', '<leader>wl',
|
||||
-- '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>')
|
||||
-- Workspace stuff
|
||||
-- map(bufnr, 'n', '<leader>wa',
|
||||
-- '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>')
|
||||
-- map(bufnr, 'n', '<leader>wr',
|
||||
-- '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>')
|
||||
-- map(bufnr, 'n', '<leader>wl',
|
||||
-- '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>')
|
||||
|
||||
-- Code actions
|
||||
map(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>')
|
||||
map(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>')
|
||||
map(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>')
|
||||
map(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>')
|
||||
map(bufnr, 'n', '<leader>f',
|
||||
'<cmd>lua vim.lsp.buf.format({async = true})<CR>')
|
||||
-- Code actions
|
||||
map(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>')
|
||||
map(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>')
|
||||
map(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>')
|
||||
map(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>')
|
||||
map(bufnr, 'n', '<leader>f',
|
||||
'<cmd>lua vim.lsp.buf.format({async = true})<CR>')
|
||||
|
||||
print("Initialized language server!")
|
||||
print("Initialized language server!")
|
||||
end
|
||||
|
||||
local function on_attach_typescript(client, bufnr)
|
||||
-- We handle formatting using null-ls and prettierd
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
-- We handle formatting using null-ls and prettierd
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
|
||||
M.on_attach(client, bufnr)
|
||||
end
|
||||
|
||||
local function on_attach_nix(c, b)
|
||||
A.chordSilent("n", "ug",
|
||||
":lua require('my.helpers.update-nix-fetchgit').update()<CR>",
|
||||
{settings = "b"})
|
||||
|
||||
M.on_attach(c, b)
|
||||
M.on_attach(client, bufnr)
|
||||
end
|
||||
|
||||
-- General server config
|
||||
local servers = {
|
||||
tsserver = {on_attach = on_attach_typescript},
|
||||
dhall_lsp_server = {},
|
||||
sumneko_lua = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = runtime_path
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'}
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true)
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {enable = false}
|
||||
}
|
||||
tsserver = { on_attach = on_attach_typescript },
|
||||
dhall_lsp_server = {},
|
||||
sumneko_lua = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = runtime_path
|
||||
},
|
||||
cmd = {"lua-language-server"}
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' }
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true)
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = { enable = false }
|
||||
}
|
||||
},
|
||||
purescriptls = {
|
||||
settings = {
|
||||
purescript = {
|
||||
censorWarnings = {
|
||||
"UnusedName", "ShadowedName", "UserDefinedWarning"
|
||||
},
|
||||
formatter = "purs-tidy"
|
||||
}
|
||||
}
|
||||
},
|
||||
rnix = {on_attach = on_attach_nix},
|
||||
hls = {
|
||||
haskell = {
|
||||
-- set formatter
|
||||
formattingProvider = "ormolu"
|
||||
}
|
||||
},
|
||||
cssls = {}
|
||||
-- agda = {}, Haven't gotten this one to work yet
|
||||
cmd = { "lua-language-server" }
|
||||
},
|
||||
purescriptls = {
|
||||
settings = {
|
||||
purescript = {
|
||||
censorWarnings = {
|
||||
"UnusedName", "ShadowedName", "UserDefinedWarning"
|
||||
},
|
||||
formatter = "purs-tidy"
|
||||
}
|
||||
}
|
||||
},
|
||||
hls = {
|
||||
haskell = {
|
||||
-- set formatter
|
||||
formattingProvider = "ormolu"
|
||||
}
|
||||
},
|
||||
rnix = {},
|
||||
cssls = {}
|
||||
-- agda = {}, Haven't gotten this one to work yet
|
||||
}
|
||||
|
||||
function M.setup()
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp
|
||||
.protocol
|
||||
.make_client_capabilities())
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp
|
||||
.protocol
|
||||
.make_client_capabilities())
|
||||
|
||||
-- Setup basic language servers
|
||||
for lsp, details in pairs(servers) do
|
||||
if details.on_attach == nil then
|
||||
-- Default setting for on_attach
|
||||
details.on_attach = M.on_attach
|
||||
end
|
||||
|
||||
require('lspconfig')[lsp].setup {
|
||||
on_attach = details.on_attach,
|
||||
settings = details.settings, -- Specific per-language settings
|
||||
flags = {
|
||||
debounce_text_changes = 150 -- This will be the default in neovim 0.7+
|
||||
},
|
||||
cmd = details.cmd,
|
||||
capabilities = capabilities
|
||||
}
|
||||
-- Setup basic language servers
|
||||
for lsp, details in pairs(servers) do
|
||||
if details.on_attach == nil then
|
||||
-- Default setting for on_attach
|
||||
details.on_attach = M.on_attach
|
||||
end
|
||||
|
||||
require('lspconfig')[lsp].setup {
|
||||
on_attach = details.on_attach,
|
||||
settings = details.settings, -- Specific per-language settings
|
||||
flags = {
|
||||
debounce_text_changes = 150 -- This will be the default in neovim 0.7+
|
||||
},
|
||||
cmd = details.cmd,
|
||||
capabilities = capabilities
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -7,7 +7,7 @@ function M.setup()
|
|||
|
||||
local sources = {
|
||||
null_ls.builtins.formatting.prettierd.with({extra_filetypes = {}}), -- format ts files
|
||||
null_ls.builtins.formatting.lua_format -- format lua code
|
||||
-- null_ls.builtins.formatting.lua_format -- format lua code
|
||||
}
|
||||
|
||||
null_ls.setup({sources = sources, on_attach = lspconfig.on_attach})
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = {
|
||||
"bash", "javascript", "typescript", "c", "cpp", "css", "dockerfile",
|
||||
"elixir", "fish", "html", "json", "latex", "python", "rust", "scss",
|
||||
"toml", "tsx", "vim", "yaml", "nix"
|
||||
},
|
||||
sync_install = false,
|
||||
indent = {enable = true},
|
||||
highlight = {
|
||||
enable = false,
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = {
|
||||
"bash", "javascript", "typescript", "c", "cpp", "css", "dockerfile",
|
||||
"elixir", "fish", "html", "json", "latex", "python", "rust", "scss",
|
||||
"toml", "tsx", "vim", "yaml", "nix"
|
||||
},
|
||||
sync_install = false,
|
||||
indent = { enable = true },
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false
|
||||
}
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue