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
|
-- general vim settings
|
||||||
require('config.settings') -- general vim settings
|
require('config.settings') -- general vim settings
|
||||||
require('config.keymaps') -- general vim keymaps
|
require('config.keymaps') -- general vim keymaps
|
||||||
require('config.platform_specific') -- platform specific settings (Win32, Mac, Linux)
|
require('config.platform_specific') -- platform specific settings (Win32, Mac, Linux)
|
||||||
|
|
||||||
-- plugin configurations
|
-- plugin configurations
|
||||||
require('config.lazy') -- nvim plugins
|
require('config.lazy') -- nvim plugin mgmt
|
||||||
require('plugin-config') -- plugin specific configurations
|
require('config.plugins') -- plugin specific configurations
|
||||||
|
|
||||||
-- local config
|
-- local config
|
||||||
require('config.local')
|
require('config.local')
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
-- source local rc file
|
-- source local rc file
|
||||||
local local_rc = vim.fn.expand("~/.local/.nvimrc")
|
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_prev)
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||||
|
|
||||||
|
-- set keymaps for LSP servers on attach to buffer
|
||||||
local on_attach = function(_, bufnr)
|
local on_attach = function(_, bufnr)
|
||||||
local nmap = function(keys, func, desc)
|
local nmap = function(keys, func, desc)
|
||||||
if desc then
|
if desc then
|
||||||
@ -37,8 +38,10 @@ local on_attach = function(_, bufnr)
|
|||||||
end, { desc = 'Format current buffer with LSP' })
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- mason - package manager for lsp servers
|
-- nvim-cmp - extend capabilities of LSP (for text completions)
|
||||||
require('mason').setup()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
'clangd',
|
'clangd',
|
||||||
'rust_analyzer',
|
'rust_analyzer',
|
||||||
@ -50,11 +53,10 @@ local servers = {
|
|||||||
'lua_ls',
|
'lua_ls',
|
||||||
'bashls'
|
'bashls'
|
||||||
}
|
}
|
||||||
require('mason-lspconfig').setup({ ensure_installed = servers })
|
|
||||||
|
|
||||||
-- nvim-cmp - extend capabilities
|
-- mason - package manager for lsp servers
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
require('mason').setup()
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
require('mason-lspconfig').setup({ ensure_installed = servers })
|
||||||
|
|
||||||
-- loop through servers, adding keymaps and capabilities
|
-- loop through servers, adding keymaps and capabilities
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
@ -63,32 +65,25 @@ for _, lsp in ipairs(servers) do
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
-- -- fidget - for lsp status above statusline
|
||||||
-- fidget - for lsp status above statusline
|
|
||||||
require('fidget').setup()
|
require('fidget').setup()
|
||||||
|
|
||||||
-- lua lsp config
|
-- -- lua lsp config
|
||||||
-- Make runtime files discoverable to the server
|
-- -- Make runtime files discoverable to the server
|
||||||
local runtime_path = vim.split(package.path, ';')
|
-- local runtime_path = vim.split(package.path, ';')
|
||||||
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')
|
||||||
|
|
||||||
require('lspconfig').lua_ls.setup {
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = { version = 'LuaJIT', path = runtime_path, },
|
||||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT)
|
diagnostics = { globals = { 'vim', 'require' } },
|
||||||
version = 'LuaJIT',
|
|
||||||
-- Setup your lua path
|
|
||||||
path = runtime_path,
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' },
|
|
||||||
},
|
|
||||||
workspace = { library = vim.api.nvim_get_runtime_file('', true), checkThirdParty = false, },
|
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 },
|
telemetry = { enable = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1,5 +1,5 @@
|
|||||||
-- settings.lua
|
-- settings.lua
|
||||||
-- general settings
|
-- general settings for basic vim
|
||||||
|
|
||||||
-- encoding/format
|
-- encoding/format
|
||||||
vim.opt.encoding = 'utf-8'
|
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