Removed unused plugin for lsp
This commit is contained in:
parent
5499c8a593
commit
b6ce792072
|
@ -0,0 +1 @@
|
|||
source "$HOME/.cargo/env.fish"
|
|
@ -16,18 +16,10 @@ switch (uname)
|
|||
end
|
||||
|
||||
# PATH
|
||||
# Local PATH
|
||||
#export PATH=$PATH:$HOME/.local/bin
|
||||
# Rust
|
||||
source "$HOME/.cargo/env.fish"
|
||||
|
||||
## Ruby PATH
|
||||
#export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
|
||||
|
||||
## Homebrew binaries PATH
|
||||
#export PATH="/opt/homebrew/bin:$PATH"
|
||||
#export PATH="/opt/homebrew/sbin:$PATH"
|
||||
#eval "$(brew shellenv)"
|
||||
|
||||
## pyenv
|
||||
# pyenv
|
||||
#export PYENV_ROOT="$HOME/.pyenv"
|
||||
#export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
pyenv init - | source
|
||||
|
|
|
@ -30,4 +30,4 @@ SETUVAR fish_pager_color_description:yellow\x1e\x2di
|
|||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||
SETUVAR fish_user_paths:/Users/administrator/\x2elocal/bin\x1e/opt/homebrew/opt/ruby/bin\x1e/opt/homebrew/sbin\x1e/opt/homebrew/bin
|
||||
SETUVAR fish_user_paths:/Users/administrator/\x2elocal/share/nvim/mason/bin\x1e/Users/administrator/\x2elocal/bin\x1e/opt/homebrew/opt/ruby/bin\x1e/opt/homebrew/sbin\x1e/opt/homebrew/bin
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
require("tokyonight").setup {
|
||||
transparent = false,
|
||||
styles = {
|
||||
sidebars = "transparent",
|
||||
floats = "transparent",
|
||||
}
|
||||
}
|
||||
|
||||
vim.cmd [[colorscheme tokyonight-night]]
|
||||
-- vim.cmd [[colorscheme tokyonight-day]]
|
||||
-- vim.cmd [[set notermguicolors]]
|
||||
vim.cmd [[hi Normal guibg=none]]
|
|
@ -0,0 +1,47 @@
|
|||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"lua",
|
||||
"query",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"rust",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (or "all")
|
||||
ignore_install = { "javascript" },
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||
-- the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
disable = {
|
||||
"tex",
|
||||
},
|
||||
|
||||
-- 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,
|
||||
},
|
||||
})
|
|
@ -0,0 +1,11 @@
|
|||
local mason = require("mason")
|
||||
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,120 @@
|
|||
local lspconfig = require 'lspconfig'
|
||||
|
||||
local on_attach = function(client)
|
||||
require 'completion'.on_attach(client)
|
||||
end
|
||||
|
||||
-- BASH
|
||||
lspconfig.bashls.setup({})
|
||||
|
||||
-- CLANG
|
||||
lspconfig.clangd.setup({})
|
||||
|
||||
-- CMAKE
|
||||
lspconfig.cmake.setup({})
|
||||
|
||||
-- LATEX
|
||||
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
|
||||
local words = {}
|
||||
|
||||
for word in io.open(path, "r"):lines() do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
require('lspconfig').ltex.setup({
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
dictionary = {
|
||||
["en-GB"] = words,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- LUA
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
neededFileStatus = {
|
||||
["codestyle-check"] = "Any",
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
format = {
|
||||
enable = true,
|
||||
-- Put format options here
|
||||
-- NOTE: the value should be STRING!!
|
||||
defaultConfig = {
|
||||
indent_style = "space",
|
||||
indent_size = "4",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
-- PYTHON
|
||||
require('lspconfig').pylsp.setup {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- formatter options
|
||||
black = { enabled = true },
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
-- linter options
|
||||
pylint = { enabled = false, executable = "pylint" },
|
||||
pyflakes = { enabled = false },
|
||||
pycodestyle = { enabled = true, maxLineLength = 110 },
|
||||
-- type checker
|
||||
pylsp_mypy = { enabled = true },
|
||||
-- auto-completion options
|
||||
jedi_completion = { fuzzy = true },
|
||||
-- import sorting
|
||||
pyls_isort = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 200,
|
||||
},
|
||||
}
|
||||
|
||||
-- RUST
|
||||
lspconfig.rust_analyzer.setup({
|
||||
-- on_attach = on_attach,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,103 @@
|
|||
-- Set up nvim-cmp.
|
||||
local cmp = require 'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'vsnip' }, -- For vsnip users.
|
||||
-- { name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
|
||||
-- Set configuration for specific filetype.
|
||||
--[[ cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require("cmp_git").setup() ]]--
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
-- BASH
|
||||
require('lspconfig')['bashls'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- CLANG
|
||||
require('lspconfig')['clangd'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- CMAKE
|
||||
require('lspconfig')['cmake'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- LUA
|
||||
require('lspconfig')['lua_ls'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- LaTeX
|
||||
require('lspconfig')['ltex'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- PYTHON
|
||||
require('lspconfig')['pylsp'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- RUST
|
||||
require('lspconfig')['rust_analyzer'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = {
|
||||
'bashls',
|
||||
'clangd',
|
||||
'cmake',
|
||||
'lua_ls',
|
||||
'ltex',
|
||||
'pylsp',
|
||||
'rust_analyzer',
|
||||
},
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
--require("tokyonight").setup {
|
||||
-- transparent = false,
|
||||
-- -- styles = {
|
||||
-- -- sidebars = "transparent",
|
||||
-- -- floats = "transparent",
|
||||
-- -- }
|
||||
--}
|
||||
--
|
||||
--vim.cmd [[colorscheme tokyonight-night]]
|
||||
---- vim.cmd [[colorscheme tokyonight-day]]
|
||||
---- vim.cmd [[hi Normal guibg=none]]
|
||||
|
||||
vim.cmd [[set notermguicolors]]
|
||||
vim.cmd [[hi Normal guibg=none]]
|
|
@ -1,415 +0,0 @@
|
|||
local lsp = require('lsp-zero')
|
||||
|
||||
local f = io.popen("uname -s")
|
||||
if (f ~= nil) then
|
||||
MY_OS = f:read("*a")
|
||||
MY_OS = string.gsub(MY_OS, "%s+", "")
|
||||
f:close()
|
||||
end
|
||||
|
||||
local f = io.popen("uname -m")
|
||||
if (f ~= nil) then
|
||||
MY_ARCH = f:read("*a")
|
||||
MY_ARCH = string.gsub(MY_ARCH, "%s+", "")
|
||||
f:close()
|
||||
end
|
||||
|
||||
lsp.preset("recommended")
|
||||
|
||||
if (MY_OS == 'Linux')
|
||||
then
|
||||
if (MY_ARCH == 'aarch64')
|
||||
then
|
||||
lsp.ensure_installed({
|
||||
-- Replace these with whatever servers you want to install
|
||||
'bashls',
|
||||
'julials',
|
||||
'ltex',
|
||||
'pylsp',
|
||||
'rust_analyzer',
|
||||
})
|
||||
else
|
||||
lsp.ensure_installed({
|
||||
-- Replace these with whatever servers you want to install
|
||||
'bashls',
|
||||
'clangd',
|
||||
'cmake',
|
||||
'julials',
|
||||
'lua_ls',
|
||||
'ltex',
|
||||
'pylsp',
|
||||
'rust_analyzer',
|
||||
})
|
||||
|
||||
end
|
||||
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
|
||||
then
|
||||
lsp.ensure_installed({
|
||||
-- Replace these with whatever servers you want to install
|
||||
'bashls',
|
||||
'pylsp'
|
||||
})
|
||||
elseif (MY_OS == 'Darwin')
|
||||
then
|
||||
lsp.ensure_installed({
|
||||
-- Replace these with whatever servers you want to install
|
||||
'clangd',
|
||||
'cmake',
|
||||
'julials',
|
||||
'lua_ls',
|
||||
'ltex',
|
||||
'pylsp',
|
||||
'rust_analyzer',
|
||||
})
|
||||
else
|
||||
print('Should never be here LSP')
|
||||
end
|
||||
|
||||
vim.cmd([[
|
||||
set rtp^=~/.opam/default/share/ocp-indent/vim
|
||||
]])
|
||||
|
||||
local cmp = require("cmp")
|
||||
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
lsp.setup_nvim_cmp({
|
||||
mapping = cmp_mappings
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts, { desc = "LSP Goto Reference" })
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts, { desc = "LSP Goto Definition" })
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts, { desc = "LSP Hover" })
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts,
|
||||
{ desc = "LSP Workspace Symbol" })
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.setloclist() end, opts, { desc = "LSP Show Diagnostics" })
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts, { desc = "Next Diagnostic" })
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts, { desc = "Previous Diagnostic" })
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts, { desc = "LSP Code Action" })
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts, { desc = "LSP References" })
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts, { desc = "LSP Rename" })
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts, { desc = "LSP Signature Help" })
|
||||
end)
|
||||
|
||||
|
||||
if (MY_OS == 'Linux')
|
||||
then
|
||||
-- Installed for Linux
|
||||
require('lspconfig').bashls.setup({})
|
||||
|
||||
require('lspconfig').clangd.setup({})
|
||||
|
||||
require('lspconfig').cmake.setup({})
|
||||
|
||||
--require('lspconfig').gopls.setup({})
|
||||
|
||||
require('lspconfig').julials.setup({})
|
||||
|
||||
--require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||
require('lspconfig').lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
neededFileStatus = {
|
||||
["codestyle-check"] = "Any",
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
format = {
|
||||
enable = true,
|
||||
-- Put format options here
|
||||
-- NOTE: the value should be STRING!!
|
||||
defaultConfig = {
|
||||
indent_style = "space",
|
||||
indent_size = "4",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
|
||||
local words = {}
|
||||
|
||||
for word in io.open(path, "r"):lines() do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
require('lspconfig').ltex.setup({
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
dictionary = {
|
||||
["en-GB"] = words,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('lspconfig').pylsp.setup {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- formatter options
|
||||
black = { enabled = true },
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
-- linter options
|
||||
pylint = { enabled = false, executable = "pylint" },
|
||||
pyflakes = { enabled = false },
|
||||
pycodestyle = { enabled = true, maxLineLength = 110 },
|
||||
-- type checker
|
||||
pylsp_mypy = { enabled = true },
|
||||
-- auto-completion options
|
||||
jedi_completion = { fuzzy = true },
|
||||
-- import sorting
|
||||
pyls_isort = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 200,
|
||||
},
|
||||
}
|
||||
|
||||
require('lspconfig').rust_analyzer.setup({
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
diagnostics = {
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
|
||||
then
|
||||
-- Installed for BSD
|
||||
require('lspconfig').bashls.setup({})
|
||||
|
||||
require('lspconfig').clangd.setup({})
|
||||
|
||||
require('lspconfig').cmake.setup({})
|
||||
|
||||
require('lspconfig').ltex.setup({
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
dictionary = {
|
||||
["en-GB"] = words,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('lspconfig').pylsp.setup {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- formatter options
|
||||
black = { enabled = true },
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
-- linter options
|
||||
pylint = { enabled = false, executable = "pylint" },
|
||||
pyflakes = { enabled = false },
|
||||
pycodestyle = { enabled = true, maxLineLength = 110 },
|
||||
-- type checker
|
||||
pylsp_mypy = { enabled = true },
|
||||
-- auto-completion options
|
||||
jedi_completion = { fuzzy = true },
|
||||
-- import sorting
|
||||
pyls_isort = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 200,
|
||||
},
|
||||
}
|
||||
|
||||
require('lspconfig').rust_analyzer.setup({
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
diagnostics = {
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
elseif (MY_OS == 'Darwin')
|
||||
then
|
||||
-- Installed for Linux
|
||||
require('lspconfig').clangd.setup({})
|
||||
|
||||
require('lspconfig').cmake.setup({})
|
||||
|
||||
--require('lspconfig').gopls.setup({})
|
||||
|
||||
require('lspconfig').julials.setup({})
|
||||
|
||||
--require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||
require('lspconfig').lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
neededFileStatus = {
|
||||
["codestyle-check"] = "Any",
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
format = {
|
||||
enable = true,
|
||||
-- Put format options here
|
||||
-- NOTE: the value should be STRING!!
|
||||
defaultConfig = {
|
||||
indent_style = "space",
|
||||
indent_size = "4",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
|
||||
local words = {}
|
||||
|
||||
for word in io.open(path, "r"):lines() do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
require('lspconfig').ltex.setup({
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
dictionary = {
|
||||
["en-GB"] = words,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('lspconfig').pylsp.setup {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- formatter options
|
||||
black = { enabled = true },
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
-- linter options
|
||||
pylint = { enabled = false, executable = "pylint" },
|
||||
pyflakes = { enabled = false },
|
||||
pycodestyle = { enabled = true, maxLineLength = 110 },
|
||||
-- type checker
|
||||
pylsp_mypy = { enabled = true },
|
||||
-- auto-completion options
|
||||
jedi_completion = { fuzzy = true },
|
||||
-- import sorting
|
||||
pyls_isort = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 200,
|
||||
},
|
||||
}
|
||||
|
||||
require('lspconfig').rust_analyzer.setup({
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
diagnostics = {
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
else
|
||||
print('Should never be here LSP config')
|
||||
end
|
||||
|
||||
|
||||
|
||||
lsp.setup()
|
||||
|
||||
local cmp_action = require('lsp-zero').cmp_action()
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
-- `/` cmdline setup.
|
||||
cmp.setup.cmdline('/', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- `:` cmdline setup.
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{
|
||||
name = 'cmdline',
|
||||
option = {
|
||||
ignore_cmds = { 'Man', '!' }
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip', keyword_length = 2 },
|
||||
{ name = 'buffer', keyword_length = 3 },
|
||||
{ name = 'path' },
|
||||
},
|
||||
mapping = {
|
||||
['<C-f>'] = cmp_action.luasnip_jump_forward(),
|
||||
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||
['<Tab>'] = cmp_action.luasnip_supertab(),
|
||||
['<S-Tab>'] = cmp_action.luasnip_shift_supertab(),
|
||||
},
|
||||
})
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
local f = io.popen("uname -s")
|
||||
if (f ~= nil) then
|
||||
MY_OS = f:read("*a")
|
||||
MY_OS = string.gsub(MY_OS, "%s+", "")
|
||||
f:close()
|
||||
end
|
||||
|
||||
if (MY_OS == 'Linux')
|
||||
then
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"json",
|
||||
"julia",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"zig",
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
|
||||
then
|
||||
--print('Should be here if on BSD')
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"json",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"zig",
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
elseif (MY_OS == 'Darwin')
|
||||
then
|
||||
--print('Should be here if on MacOS')
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"julia",
|
||||
"json",
|
||||
"lua",
|
||||
"ocaml",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"zig",
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
else
|
||||
print('Should never be here')
|
||||
end
|
|
@ -15,31 +15,29 @@ vim.g.mapleader = ' '
|
|||
vim.g.maplocalleader = ' '
|
||||
|
||||
local plugins = {
|
||||
-- Language server configuration
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
{
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{ 'neovim/nvim-lspconfig' }, -- Required
|
||||
{ -- Optional
|
||||
'williamboman/mason.nvim',
|
||||
build = function()
|
||||
pcall(vim.cmd, 'MasonUpdate')
|
||||
end,
|
||||
},
|
||||
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{ 'hrsh7th/nvim-cmp' }, -- Required
|
||||
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
|
||||
{ 'L3MON4D3/LuaSnip' }, -- Required
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
}
|
||||
'williamboman/mason.nvim',
|
||||
build = function()
|
||||
pcall(vim.cmd, 'MasonUpdate')
|
||||
end,
|
||||
},
|
||||
{ 'williamboman/mason-lspconfig.nvim' },
|
||||
|
||||
-- Autocompletion
|
||||
{ 'hrsh7th/nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
|
||||
-- -- For luasnip users
|
||||
{ 'L3MON4D3/LuaSnip' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
|
||||
-- Helper package for cmp
|
||||
{
|
||||
'nvimtools/none-ls.nvim',
|
||||
config = function()
|
||||
|
@ -49,6 +47,7 @@ local plugins = {
|
|||
end,
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
{ "simrat39/rust-tools.nvim" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
|
@ -58,6 +57,7 @@ local plugins = {
|
|||
lazy = false, -- we don't want to lazy load VimTeX
|
||||
-- tag = "v2.15", -- uncomment to pin to a specific release
|
||||
},
|
||||
{ 'echasnovski/mini.nvim', version = '*' },
|
||||
-- Minimal
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
|
@ -97,6 +97,13 @@ local plugins = {
|
|||
require('Comment').setup()
|
||||
end
|
||||
},
|
||||
-- Colorscheme
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
},
|
||||
-- Autoclose parenthesis
|
||||
{ 'm4xshen/autoclose.nvim' },
|
||||
-- tree navigator
|
||||
|
|
|
@ -189,8 +189,8 @@ then
|
|||
vim.opt.wrap = true
|
||||
-- Fonts
|
||||
vim.opt.encoding = "utf-8"
|
||||
vim.opt.guifont = "FiraCodeNerdFont-Regular:h10"
|
||||
|
||||
-- Undo
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
|
@ -226,8 +226,6 @@ then
|
|||
-- Vimtex options:
|
||||
vim.g.vimtex_view_method = "sioyek"
|
||||
vim.g.vimtex_view_sioyek_exe = "/Applications/sioyek.app/Contents/MacOS/sioyek"
|
||||
-- vim.g.vimtex_view_method = "zathura"
|
||||
-- vim.g.vimtex_general_viewer = "zathura"
|
||||
vim.g.vimtex_quickfix_mode = 0
|
||||
|
||||
-- Ignore mappings
|
||||
|
@ -248,7 +246,7 @@ then
|
|||
})
|
||||
|
||||
-- Python provider
|
||||
vim.g.python3_host_prog = "/usr/local/share/pyenv/shims/python"
|
||||
vim.g.python3_host_prog = "$HOME/.pyenv/shims/python"
|
||||
else
|
||||
print('Should never be here LSP')
|
||||
end
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
.gnupg/private-keys-v1.d/*
|
||||
.gnupg/public-keys.d/*
|
||||
.gnupg/random_seed
|
||||
.gnupg/reader_0.status
|
||||
.ssh/known_hosts*
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
USABLE
|
|
@ -1,3 +1,7 @@
|
|||
# Neovim required
|
||||
set-option -g focus-events on
|
||||
set-option -a terminal-features 'alacritty:RGB'
|
||||
|
||||
#set -g default-terminal "screen-256color"
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
|
|
Loading…
Reference in New Issue