Merge pull request 'Neovim config updates' (#13) from nvim-updates-10162022b into main

Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/13
This commit is contained in:
Salar Rahmanian 2022-10-16 21:31:30 +00:00
commit 7cf74a25ef

View file

@ -13,18 +13,16 @@ local function load_plugins()
use 'folke/which-key.nvim' use 'folke/which-key.nvim'
use 'folke/neodev.nvim' use 'folke/neodev.nvim'
use 'folke/tokyonight.nvim' -- Theme use 'folke/tokyonight.nvim' -- Theme
use { 'folke/trouble.nvim', requires = 'kyazdani42/nvim-web-devicons' } use { 'folke/trouble.nvim' }
use { 'justinhj/battery.nvim', requires = {{'kyazdani42/nvim-web-devicons'}, {'nvim-lua/plenary.nvim'}}} use { 'justinhj/battery.nvim', requires = 'nvim-lua/plenary.nvim'}
use { 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/popup.nvim' }, { 'nvim-lua/plenary.nvim' } } } use { 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/popup.nvim' }, { 'nvim-lua/plenary.nvim' } } }
use 'nvim-telescope/telescope-dap.nvim' use 'nvim-telescope/telescope-dap.nvim'
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
use { 'softinio/scaladex.nvim' } use { 'softinio/scaladex.nvim' }
use 'windwp/nvim-autopairs' -- Autopairs use 'windwp/nvim-autopairs' -- Autopairs
use 'nvim-tree/nvim-web-devicons'
use { use {
'nvim-tree/nvim-tree.lua', 'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},
tag = 'nightly' -- optional, updated every week. (see issue #1193) tag = 'nightly' -- optional, updated every week. (see issue #1193)
} }
use { use {
@ -32,7 +30,6 @@ local function load_plugins()
config = function() config = function()
require 'salargalaxyline' require 'salargalaxyline'
end, end,
requires = 'kyazdani42/nvim-web-devicons',
} }
use 'lukas-reineke/indent-blankline.nvim' use 'lukas-reineke/indent-blankline.nvim'
use { 'lewis6991/gitsigns.nvim', requires = 'nvim-lua/plenary.nvim' } use { 'lewis6991/gitsigns.nvim', requires = 'nvim-lua/plenary.nvim' }
@ -459,6 +456,7 @@ _G.load_config = function()
-- Y yank until the end of line -- Y yank until the end of line
vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true }) vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true })
-- --
-- LSP settings -- LSP settings
local nvim_lsp = require 'lspconfig' local nvim_lsp = require 'lspconfig'
@ -507,44 +505,24 @@ _G.load_config = function()
table.insert(runtime_path, 'lua/?.lua') table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua') table.insert(runtime_path, 'lua/?/init.lua')
local neodev = require('neodev').setup{ require("neodev").setup({
lspconfig = { override = function(root_dir, library)
cmd = { sumneko_binary }, if require("neodev.util").has_file(root_dir, "/etc/nixos") then
commands = { library.enabled = true
Format = { library.plugins = true
function() end
require('stylua-nvim').format_file()
end, end,
}, })
},
on_attach = on_attach, nvim_lsp.sumneko_lua.setup({
settings = { settings = {
Lua = { Lua = {
runtime = { completion = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) callSnippet = "Replace"
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,
},
},
},
},
} }
nvim_lsp.sumneko_lua.setup(neodev) }
}
})
-- metals -- metals
vim.g.metals_server_version = '0.11.9' vim.g.metals_server_version = '0.11.9'