rename plugins dir, try to fix vim global messages in lua
This commit is contained in:
parent
a0ff47a688
commit
b031d6ac1c
@ -1,13 +1,11 @@
|
||||
-- init.lua --
|
||||
|
||||
-- general vim settings
|
||||
require('config.settings') -- general vim settings
|
||||
require('config.keymaps') -- general vim keymaps
|
||||
require('config.platform_specific') -- platform specific settings (Win32, Mac, Linux)
|
||||
|
||||
-- plugin configurations
|
||||
require('config.lazy') -- nvim plugins
|
||||
require('plugin-config') -- plugin specific configurations
|
||||
require('config.lazy') -- nvim plugin mgmt
|
||||
require('config.plugins') -- plugin specific configurations
|
||||
|
||||
-- local config
|
||||
require('config.local')
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
-- source local rc file
|
||||
local local_rc = vim.fn.expand("~/.local/.nvimrc")
|
||||
if (vim.fn.filereadable(local_rc)) then vim.cmd.source(local_rc) end
|
||||
if (vim.fn.filereadable(local_rc)) then
|
||||
vim.cmd.source(local_rc)
|
||||
end
|
||||
|
||||
|
||||
27
config/nvim/.config/nvim/lua/config/plugins/init.lua
Normal file
27
config/nvim/.config/nvim/lua/config/plugins/init.lua
Normal file
@ -0,0 +1,27 @@
|
||||
-- config/plugins/init.lua
|
||||
|
||||
-- * LSP, Completion and TreeSitter * --
|
||||
-- lsp
|
||||
require('config.plugins.lsp')
|
||||
-- completion
|
||||
require('config.plugins.cmp')
|
||||
-- treesitter (tree based syntax highlighting)
|
||||
require('config.plugins.nvim-treesitter')
|
||||
|
||||
-- * File explorer and Fuzzy Finder * --
|
||||
-- nvim-tree
|
||||
require('config.plugins.oil')
|
||||
-- fzf (fuzzy finder)
|
||||
require('config.plugins.fzf')
|
||||
|
||||
-- * Git Integration * --
|
||||
-- gitsigns
|
||||
require('config.plugins.gitsigns')
|
||||
-- vim-fugitive (git plugins)
|
||||
require('config.plugins.vim-fugitive')
|
||||
|
||||
-- * Discord Presence * --
|
||||
-- require('config.plugins-config.discord-presence')
|
||||
|
||||
-- colorscheme
|
||||
require('config.plugins.colorscheme')
|
||||
@ -1,9 +1,10 @@
|
||||
-- Diagnostic keymaps
|
||||
-- -- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
|
||||
-- set keymaps for LSP servers on attach to buffer
|
||||
local on_attach = function(_, bufnr)
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
@ -37,8 +38,10 @@ local on_attach = function(_, bufnr)
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- mason - package manager for lsp servers
|
||||
require('mason').setup()
|
||||
-- nvim-cmp - extend capabilities of LSP (for text completions)
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
local servers = {
|
||||
'clangd',
|
||||
'rust_analyzer',
|
||||
@ -50,11 +53,10 @@ local servers = {
|
||||
'lua_ls',
|
||||
'bashls'
|
||||
}
|
||||
require('mason-lspconfig').setup({ ensure_installed = servers })
|
||||
|
||||
-- nvim-cmp - extend capabilities
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
-- mason - package manager for lsp servers
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({ ensure_installed = servers })
|
||||
|
||||
-- loop through servers, adding keymaps and capabilities
|
||||
for _, lsp in ipairs(servers) do
|
||||
@ -63,32 +65,25 @@ for _, lsp in ipairs(servers) do
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- fidget - for lsp status above statusline
|
||||
-- -- fidget - for lsp status above statusline
|
||||
require('fidget').setup()
|
||||
|
||||
-- lua lsp config
|
||||
-- Make runtime files discoverable to the server
|
||||
local runtime_path = vim.split(package.path, ';')
|
||||
table.insert(runtime_path, 'lua/?.lua')
|
||||
table.insert(runtime_path, 'lua/?/init.lua')
|
||||
-- -- lua lsp config
|
||||
-- -- Make runtime files discoverable to the server
|
||||
-- local runtime_path = vim.split(package.path, ';')
|
||||
-- table.insert(runtime_path, 'lua/?.lua')
|
||||
-- table.insert(runtime_path, 'lua/?/init.lua')
|
||||
|
||||
require('lspconfig').lua_ls.setup {
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
lspconfig.lua_ls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
runtime = { version = 'LuaJIT', path = runtime_path, },
|
||||
diagnostics = { globals = { 'vim', 'require' } },
|
||||
workspace = { library = vim.api.nvim_get_runtime_file('', true), checkThirdParty = false, },
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
@ -1,5 +1,5 @@
|
||||
-- settings.lua
|
||||
-- general settings
|
||||
-- general settings for basic vim
|
||||
|
||||
-- encoding/format
|
||||
vim.opt.encoding = 'utf-8'
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
-- plugin-config/init.lua
|
||||
|
||||
-- * LSP, Completion and TreeSitter * --
|
||||
-- lsp
|
||||
require('plugin-config.lsp')
|
||||
-- completion
|
||||
require('plugin-config.cmp')
|
||||
-- treesitter (tree based syntax highlighting)
|
||||
require('plugin-config.nvim-treesitter')
|
||||
|
||||
-- * File explorer and Fuzzy Finder * --
|
||||
-- nvim-tree
|
||||
require('plugin-config.oil')
|
||||
-- fzf (fuzzy finder)
|
||||
require('plugin-config.fzf')
|
||||
|
||||
-- * Git Integration * --
|
||||
-- gitsigns
|
||||
require('plugin-config.gitsigns')
|
||||
-- vim-fugitive (git plugin)
|
||||
require('plugin-config.vim-fugitive')
|
||||
|
||||
-- * Discord Presence * --
|
||||
-- require('plugin-config.discord-presence')
|
||||
|
||||
-- colorscheme
|
||||
require('plugin-config.colorscheme')
|
||||
Loading…
x
Reference in New Issue
Block a user