macboolk doesn't like lua :c
This commit is contained in:
parent
f2ba1e8549
commit
5b483a9db7
34 changed files with 279 additions and 776 deletions
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
{ -- Add indentation guides even on blank lines
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help ibl`
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
{ 'folke/noice.nvim' },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local noice = require 'noice'
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'catppuccin',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '' } } },
|
||||
lualine_x = {
|
||||
{
|
||||
noice.api.status.message.get_hl,
|
||||
cond = noice.api.status.message.has,
|
||||
},
|
||||
{
|
||||
noice.api.status.command.get,
|
||||
cond = noice.api.status.command.has,
|
||||
color = { fg = '#ff9e64' },
|
||||
},
|
||||
{
|
||||
noice.api.status.mode.get,
|
||||
cond = noice.api.status.mode.has,
|
||||
color = { fg = '#ff9e64' },
|
||||
},
|
||||
{
|
||||
noice.api.status.search.get,
|
||||
cond = noice.api.status.search.has,
|
||||
color = { fg = '#ff9e64' },
|
||||
},
|
||||
},
|
||||
lualine_z = {
|
||||
{
|
||||
'location',
|
||||
separator = { right = '' },
|
||||
left_padding = 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
'oil',
|
||||
'lazy',
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
return {
|
||||
{
|
||||
'folke/neodev.nvim',
|
||||
opts = {
|
||||
override = function(root_dir, library)
|
||||
if root_dir:find '.config/nvim' then
|
||||
library.enabled = true
|
||||
library.plugins = true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ return {
|
|||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
'<C>f',
|
||||
'<leader>f',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_fallback = true }
|
||||
end,
|
||||
|
|
@ -21,7 +21,8 @@ return {
|
|||
typescript = { 'prettier' },
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
local disable_filetypes = {--[[ c = true, cpp = true ]]
|
||||
local disable_filetypes = {
|
||||
--[[ c = true, cpp = true ]]
|
||||
}
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
43
lua/plugins/init.lua
Normal file
43
lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
return {
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
lazy = false,
|
||||
name = 'catppuccin',
|
||||
priority = 1000,
|
||||
init = function()
|
||||
vim.cmd.colorscheme 'catppuccin-mocha'
|
||||
-- You can configure highlights by doing something like:
|
||||
vim.cmd.hi 'Comment gui=none'
|
||||
end,
|
||||
opts = {
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
treesitter = true,
|
||||
notify = true,
|
||||
mini = {
|
||||
enabled = true,
|
||||
},
|
||||
dashboard = true,
|
||||
fidget = true,
|
||||
mason = true,
|
||||
telescope = {
|
||||
enabled = true,
|
||||
},
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{ 'tpope/vim-sleuth' },
|
||||
{
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
main = 'ibl',
|
||||
opts = {
|
||||
exclude = {
|
||||
filetypes = {
|
||||
'dashboard',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@ return {
|
|||
'mfussenegger/nvim-lint',
|
||||
init = function()
|
||||
require('lint').linters_by_ft = {
|
||||
javascript = { 'quick-lint-js' },
|
||||
typescript = { 'quick-lint-js' },
|
||||
javascript = { 'eslint_d' },
|
||||
typescript = { 'eslint_d' },
|
||||
json = { 'jsonlint' },
|
||||
lua = { 'luacheck' },
|
||||
go = { 'revive' },
|
||||
|
|
@ -2,16 +2,16 @@ return {
|
|||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
|
||||
'folke/neodev.nvim',
|
||||
{ 'j-hui/fidget.nvim' },
|
||||
{ 'folke/neodev.nvim' },
|
||||
},
|
||||
init = function() end,
|
||||
config = function()
|
||||
require 'plugins.neodev'
|
||||
require('neoconf').setup {}
|
||||
|
||||
-- function will be executed to configure the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
|
|
@ -40,65 +40,49 @@ return {
|
|||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
local lazyPlugins = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||
biome = {},
|
||||
tsserver = {},
|
||||
lua_ls = {
|
||||
-- cmd = {...},
|
||||
-- filetypes = { ...},
|
||||
-- capabilities = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = true,
|
||||
checkthirdparty = { lazyPlugins },
|
||||
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
-- -- depending on the usage, you might want to add additional paths here.
|
||||
-- -- "${3rd}/luv/library"
|
||||
-- -- "${3rd}/busted/library",
|
||||
-- },
|
||||
-- or pull in all of 'runtimepath'. note: this is a lot slower
|
||||
},
|
||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
-- library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { vim.env.VIMRUNTIME }),
|
||||
},
|
||||
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-f.ields' } },
|
||||
diagnostics = {
|
||||
disable = { 'missing-fields' },
|
||||
globals = { 'vim' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
jsonls = {},
|
||||
yamlls = {},
|
||||
revive = {},
|
||||
}
|
||||
|
||||
-- You can press `g?` for help in this menu.
|
||||
require('mason').setup()
|
||||
|
||||
-- You can add other tools here that you want Mason to install
|
||||
-- for you, so that they are available from within Neovim.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format Lua code
|
||||
})
|
||||
vim.list_extend(ensure_installed, { 'stylua' })
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
require('mason-lspconfig').setup {
|
||||
84
lua/plugins/lualine.lua
Normal file
84
lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
{ 'folke/noice.nvim' },
|
||||
},
|
||||
config = function()
|
||||
local noice = require 'noice'
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'catppuccin',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
'mode',
|
||||
separator = { left = '' },
|
||||
fmt = function(_, context)
|
||||
local winnr = vim.fn.tabpagewinnr(context.tabnr)
|
||||
local ok, val = pcall(vim.api.nvim_win_get_var, winnr, 'nnn')
|
||||
if ok and val then
|
||||
return 'nnn'
|
||||
end
|
||||
end,
|
||||
color = function(section)
|
||||
local winnr = vim.api.nvim_get_current_win()
|
||||
local ok, val = pcall(vim.api.nvim_win_get_var, winnr, 'nnn')
|
||||
if ok and val then
|
||||
return { fg = '#054fca' }
|
||||
end
|
||||
return {}
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
noice.api.status.message.get_hl,
|
||||
cond = noice.api.status.message.has,
|
||||
},
|
||||
{
|
||||
noice.api.status.command.get_hl,
|
||||
cond = noice.api.status.command.has,
|
||||
color = { fg = '#ff0000' },
|
||||
},
|
||||
{
|
||||
noice.api.status.mode.get,
|
||||
cond = noice.api.status.mode.has,
|
||||
color = { fg = '#00ff00' },
|
||||
},
|
||||
},
|
||||
lualine_z = {
|
||||
{
|
||||
'location',
|
||||
separator = { right = '' },
|
||||
left_padding = 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
'oil',
|
||||
'lazy',
|
||||
},
|
||||
}
|
||||
|
||||
-- vim.api.nvim_create_autocmd({ 'BufEnter' }, {
|
||||
-- callback = function(ev)
|
||||
-- local filetype = vim.api.nvim_get_option_value('filetype', { buf = ev.buf })
|
||||
--
|
||||
-- print(string.format('event fired: %s', filetype))
|
||||
-- if filetype == 'oil' then
|
||||
-- local ok, value = pcall(vim.api.nvim_buf_get_var, ev.buf, 'nnn')
|
||||
-- if not ok then
|
||||
-- vim.api.nvim_buf_set_var(ev.buf, 'nnn', true)
|
||||
-- end
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
end,
|
||||
},
|
||||
}
|
||||
6
lua/plugins/neoconf.lua
Normal file
6
lua/plugins/neoconf.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
{
|
||||
'folke/neoconf.nvim',
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
17
lua/plugins/neodev.lua
Normal file
17
lua/plugins/neodev.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
{
|
||||
'folke/neodev.nvim',
|
||||
opts = {
|
||||
library = {
|
||||
enabled = true,
|
||||
runtime = true,
|
||||
types = true,
|
||||
plugins = true,
|
||||
-- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" },
|
||||
},
|
||||
setup_jsonls = true,
|
||||
lspconfig = true,
|
||||
pathStrict = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ return {
|
|||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
|
||||
-- For an understanding of why these mappings were
|
||||
-- chosen, you will need to read `:help ins-completion`
|
||||
-- chosen, you will need to reaźd `:help ins-completion`
|
||||
--
|
||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
|
|
@ -71,12 +71,12 @@ return {
|
|||
--
|
||||
-- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- <c-h> is similar, except moving you backwards.
|
||||
['<C-l>'] = cmp.mapping(function()
|
||||
['<Tab>'] = cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<C-h>'] = cmp.mapping(function()
|
||||
['<S-Tab>'] = cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
|
|
@ -86,9 +86,11 @@ return {
|
|||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lua' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
}),
|
||||
|
|
@ -3,7 +3,8 @@ return {
|
|||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'javascript', 'typescript' },
|
||||
|
||||
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
|
@ -1,24 +1,26 @@
|
|||
return {
|
||||
{
|
||||
'b0o/schemastore.nvim',
|
||||
depenencies = {
|
||||
dependencies = {
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
},
|
||||
config = function()
|
||||
require('lspconfig').jsonls.setup {
|
||||
local schemastore = require 'schemastore'
|
||||
local lspconfig = require 'lspconfig'
|
||||
lspconfig.jsonls.setup {
|
||||
settigns = {
|
||||
json = {
|
||||
schemas = require('schemastore').json.schemas(),
|
||||
schemas = schemastore.json.schemas(),
|
||||
validate = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
require('lspconfig').yamlls.setup {
|
||||
lspconfig.yamlls.setup {
|
||||
settigns = {
|
||||
yaml = {
|
||||
schemas = require('schemastore').yaml.schemas(),
|
||||
schemas = schemastore.yaml.schemas(),
|
||||
},
|
||||
schemaStore = {
|
||||
enable = true,
|
||||
|
|
@ -20,8 +20,6 @@ return {
|
|||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
{ 'debugloop/telescope-undo.nvim' },
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
|
|
@ -20,15 +20,18 @@ return {
|
|||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
lsp_doc_border = true,
|
||||
lsp_doc_border = false,
|
||||
long_message_to_split = true,
|
||||
inc_rename = true,
|
||||
},
|
||||
views = {
|
||||
split = {
|
||||
enter = true,
|
||||
},
|
||||
cmdline_popup = {
|
||||
border = {
|
||||
style = 'none',
|
||||
padding = { 2, 3 },
|
||||
padding = { 2, 1 },
|
||||
},
|
||||
filter_options = {},
|
||||
win_options = {
|
||||
|
|
@ -44,22 +47,47 @@ return {
|
|||
win_options = {
|
||||
winhighlight = 'NormalFloat:NormalFloat,FloatBorder:FloatBorder',
|
||||
},
|
||||
virtualtext = {
|
||||
hl_group = 'Search',
|
||||
},
|
||||
},
|
||||
},
|
||||
routes = {
|
||||
-- {
|
||||
-- filter = {
|
||||
-- event = 'msg_show',
|
||||
-- kind = 'search_count',
|
||||
-- },
|
||||
-- opts = {
|
||||
-- skip = true,
|
||||
-- },
|
||||
-- },
|
||||
{
|
||||
view = 'notify',
|
||||
filter = { event = 'msg_showmode' },
|
||||
view = 'split',
|
||||
filter = {
|
||||
event = { 'msg_show', 'noice' },
|
||||
min_height = 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
messages = {
|
||||
enabled = true,
|
||||
view = 'notify',
|
||||
view_error = 'notify',
|
||||
view_warn = 'notify',
|
||||
view_history = 'messages',
|
||||
view_search = 'virtualtext',
|
||||
opts = {},
|
||||
},
|
||||
notify = {
|
||||
enabled = true,
|
||||
view = 'notify',
|
||||
},
|
||||
messages = {
|
||||
enabled = true,
|
||||
view = 'notify',
|
||||
opts = {},
|
||||
commands = {
|
||||
search = {
|
||||
view = 'popup',
|
||||
filter = { kind = 'search' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Loading…
Add table
Add a link
Reference in a new issue