summaryrefslogtreecommitdiff
path: root/neovim/.config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'neovim/.config/nvim/lua')
-rw-r--r--neovim/.config/nvim/lua/config/lazy.lua1
-rw-r--r--neovim/.config/nvim/lua/config/lualine.lua222
-rw-r--r--neovim/.config/nvim/lua/plugins/cspell.lua19
-rw-r--r--neovim/.config/nvim/lua/plugins/goyo.lua8
-rw-r--r--neovim/.config/nvim/lua/plugins/lualine.lua (renamed from neovim/.config/nvim/lua/plugins/galaxyline.lua)7
-rw-r--r--neovim/.config/nvim/lua/plugins/neogit.lua8
-rw-r--r--neovim/.config/nvim/lua/plugins/noice.lua94
-rw-r--r--neovim/.config/nvim/lua/plugins/nvim_cmp.lua21
-rw-r--r--neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua19
-rw-r--r--neovim/.config/nvim/lua/plugins/tabby.lua1
-rw-r--r--neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua6
11 files changed, 389 insertions, 17 deletions
diff --git a/neovim/.config/nvim/lua/config/lazy.lua b/neovim/.config/nvim/lua/config/lazy.lua
index 7e08cf4..b82d897 100644
--- a/neovim/.config/nvim/lua/config/lazy.lua
+++ b/neovim/.config/nvim/lua/config/lazy.lua
@@ -1,5 +1,6 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+---@diagnostic disable-next-line: undefined-field
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
diff --git a/neovim/.config/nvim/lua/config/lualine.lua b/neovim/.config/nvim/lua/config/lualine.lua
new file mode 100644
index 0000000..f2883d7
--- /dev/null
+++ b/neovim/.config/nvim/lua/config/lualine.lua
@@ -0,0 +1,222 @@
+-- Eviline config for lualine
+-- Author: shadmansaleh
+-- Credit: glepnir
+local lualine = require('lualine')
+
+-- Color table for highlights
+--stylua: ignore
+local colors = {
+ bg = 'StatusLine',
+ fg = 'StatusLine',
+ yellow = vim.g.terminal_color_11,
+ cyan = vim.g.terminal_color_14,
+ darkblue = vim.g.terminal_color_4,
+ green = vim.g.terminal_color_10,
+ orange = vim.g.terminal_color_3,
+ violet = vim.g.terminal_color_5,
+ magenta = vim.g.terminal_color_13,
+ blue = vim.g.terminal_color_12,
+ red = vim.g.terminal_color_9,
+}
+
+local conditions = {
+ buffer_not_empty = function()
+ return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
+ end,
+ hide_in_width = function()
+ return vim.fn.winwidth(0) > 80
+ end,
+ check_git_workspace = function()
+ local filepath = vim.fn.expand('%:p:h')
+ local gitdir = vim.fn.finddir('.git', filepath .. ';')
+ return gitdir and #gitdir > 0 and #gitdir < #filepath
+ end,
+}
+
+-- Config
+local config = {
+ options = {
+ -- Disable sections and component separators
+ component_separators = '',
+ section_separators = '',
+ theme = {
+ -- We are going to use lualine_c an lualine_x as left and
+ -- right section. Both are highlighted by c theme . So we
+ -- are just setting default looks o statusline
+ normal = { c = { fg = colors.fg, bg = colors.bg } },
+ inactive = { c = { fg = colors.fg, bg = colors.bg } },
+ },
+ },
+ sections = {
+ -- these are to remove the defaults
+ lualine_a = {},
+ lualine_b = {},
+ lualine_y = {},
+ lualine_z = {},
+ -- These will be filled later
+ lualine_c = {},
+ lualine_x = {},
+ },
+ inactive_sections = {
+ -- these are to remove the defaults
+ lualine_a = {},
+ lualine_b = {},
+ lualine_y = {},
+ lualine_z = {},
+ lualine_c = {},
+ lualine_x = {},
+ },
+ extensions = { 'lazy', 'neo-tree' },
+}
+
+-- Inserts a component in lualine_c at left section
+local function ins_left(component)
+ table.insert(config.sections.lualine_c, component)
+end
+
+-- Inserts a component in lualine_x at right section
+local function ins_right(component)
+ table.insert(config.sections.lualine_x, component)
+end
+
+ins_left {
+ function()
+ return '▊'
+ end,
+ color = { fg = colors.blue }, -- Sets highlighting of component
+ padding = { left = 0, right = 1 }, -- We don't need space before this
+}
+
+ins_left {
+ -- mode component
+ function()
+ return ''
+ end,
+ color = function()
+ -- auto change color according to neovims mode
+ local mode_color = {
+ n = colors.red,
+ i = colors.green,
+ v = colors.blue,
+ [''] = colors.blue,
+ V = colors.blue,
+ c = colors.magenta,
+ no = colors.red,
+ s = colors.orange,
+ S = colors.orange,
+ [''] = colors.orange,
+ ic = colors.yellow,
+ R = colors.violet,
+ Rv = colors.violet,
+ cv = colors.red,
+ ce = colors.red,
+ r = colors.cyan,
+ rm = colors.cyan,
+ ['r?'] = colors.cyan,
+ ['!'] = colors.red,
+ t = colors.red,
+ }
+ return { fg = mode_color[vim.fn.mode()] }
+ end,
+ padding = { right = 1 },
+}
+
+ins_left {
+ -- filesize component
+ 'filesize',
+ cond = conditions.buffer_not_empty,
+}
+
+ins_left {
+ 'filetype',
+ cond = conditions.buffer_not_empty,
+ icon_only = true,
+}
+
+ins_left {
+ 'filename',
+ cond = conditions.buffer_not_empty,
+ color = { fg = colors.magenta, gui = 'bold' },
+}
+
+ins_left { 'location' }
+
+ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } }
+
+ins_left {
+ 'diagnostics',
+ sources = { 'nvim_diagnostic' },
+ symbols = { error = ' ', warn = ' ', info = ' ' },
+ diagnostics_color = {
+ error = { fg = colors.red },
+ warn = { fg = colors.yellow },
+ info = { fg = colors.cyan },
+ },
+}
+
+-- Insert mid section. You can make any number of sections in neovim :)
+-- for lualine it's any number greater then 2
+ins_left {
+ function()
+ return '%='
+ end,
+}
+
+ins_left {
+ -- Lsp server name .
+ function()
+ local msg = 'No Active Lsp'
+ local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
+ local clients = vim.lsp.get_active_clients()
+ if next(clients) == nil then
+ return msg
+ end
+ for _, client in ipairs(clients) do
+ local filetypes = client.config.filetypes
+ if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
+ return client.name
+ end
+ end
+ return msg
+ end,
+ cond = function()
+ local tbl = { ['dashboard'] = true, [''] = true }
+ if tbl[vim.bo.filetype] then
+ return false
+ elseif next(vim.lsp.get_active_clients()) == nil then
+ return false
+ end
+ return true
+ end,
+ icon = '⚙ LSP:',
+ color = { fg = colors.fg, gui = 'bold' },
+}
+
+ins_right {
+ 'branch',
+ icon = '',
+ color = { fg = colors.violet, gui = 'bold' },
+}
+
+ins_right {
+ 'diff',
+ -- Is it me or the symbol for modified us really weird
+ symbols = { added = ' ', modified = '󰝤 ', removed = ' ' },
+ diff_color = {
+ added = { fg = colors.green },
+ modified = { fg = colors.orange },
+ removed = { fg = colors.red },
+ },
+ cond = conditions.hide_in_width,
+}
+
+ins_right {
+ function()
+ return '▊'
+ end,
+ color = { fg = colors.blue },
+ padding = { left = 1 },
+}
+
+-- Now don't forget to initialize lualine
+lualine.setup(config)
diff --git a/neovim/.config/nvim/lua/plugins/cspell.lua b/neovim/.config/nvim/lua/plugins/cspell.lua
new file mode 100644
index 0000000..7293326
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/cspell.lua
@@ -0,0 +1,19 @@
+return {
+ {
+ 'nvimtools/none-ls.nvim',
+ dependencies = {
+ {
+ 'davidmh/cspell.nvim',
+ },
+ },
+ config = function ()
+ local cspell = require('cspell')
+ require('null-ls').setup {
+ sources = {
+ cspell.diagnostics,
+ cspell.code_actions,
+ }
+ }
+ end,
+ }
+}
diff --git a/neovim/.config/nvim/lua/plugins/goyo.lua b/neovim/.config/nvim/lua/plugins/goyo.lua
index bfe797a..3b2f57f 100644
--- a/neovim/.config/nvim/lua/plugins/goyo.lua
+++ b/neovim/.config/nvim/lua/plugins/goyo.lua
@@ -17,11 +17,7 @@ return {
vim.opt.scrolloff = 999
vim.opt.laststatus = 0
- local gl = require('galaxyline')
- local gls = gl.section
- gls.left = {}
- gls.mid = {}
- gls.right = {}
+ require('lualine').hide()
vim.cmd('Limelight')
vim.cmd('VimRToggleFullscreen')
@@ -36,7 +32,7 @@ return {
vim.opt.showmode = true
vim.opt.showcmd = true
vim.opt.scrolloff = 5
- dofile(script_path() .. '../config/galaxyline.lua')
+ require('lualine').hide({unhide=true})
vim.opt.laststatus = 3
vim.cmd('Limelight!')
vim.cmd('VimRToggleFullscreen')
diff --git a/neovim/.config/nvim/lua/plugins/galaxyline.lua b/neovim/.config/nvim/lua/plugins/lualine.lua
index d3f8ba7..fda2e78 100644
--- a/neovim/.config/nvim/lua/plugins/galaxyline.lua
+++ b/neovim/.config/nvim/lua/plugins/lualine.lua
@@ -1,7 +1,6 @@
return {
{
- 'nvimdev/galaxyline.nvim',
- branch = 'main',
+ 'nvim-lualine/lualine.nvim',
dependencies = {
{
'nvim-tree/nvim-web-devicons',
@@ -66,7 +65,7 @@ return {
},
event = { 'BufEnter', 'VimEnter' },
config = function()
- require('config.galaxyline')
+ require('config.lualine')
end,
- },
+ }
}
diff --git a/neovim/.config/nvim/lua/plugins/neogit.lua b/neovim/.config/nvim/lua/plugins/neogit.lua
index a0a3f90..43dcf02 100644
--- a/neovim/.config/nvim/lua/plugins/neogit.lua
+++ b/neovim/.config/nvim/lua/plugins/neogit.lua
@@ -7,11 +7,8 @@ return {
'sindrets/diffview.nvim',
},
opts = {
- disable_commit_confirmation = true,
- auto_refresh = true,
- kind = 'tab',
commit_editor = {
- kind = 'auto',
+ staged_diff_split_kind = "auto",
},
integrations = {
-- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`.
@@ -26,7 +23,8 @@ return {
-- }
-- }
--
- diffview = true
+ diffview = true,
+ telescope = true,
}
},
keys = {
diff --git a/neovim/.config/nvim/lua/plugins/noice.lua b/neovim/.config/nvim/lua/plugins/noice.lua
new file mode 100644
index 0000000..09b628e
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/noice.lua
@@ -0,0 +1,94 @@
+return {
+ {
+ 'folke/noice.nvim',
+ event = 'VeryLazy',
+ opts = {
+ lsp = {
+ -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
+ override = {
+ ['vim.lsp.util.convert_input_to_markdown_lines'] = true,
+ ['vim.lsp.util.stylize_markdown'] = true,
+ ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp
+ },
+ progress = {
+ enabled = false,
+ },
+ },
+ -- you can enable a preset for easier configuration
+ presets = {
+ bottom_search = true, -- use a classic bottom cmdline for search
+ command_palette = true, -- position the cmdline and popupmenu together
+ long_message_to_split = true, -- long messages will be sent to a split
+ inc_rename = false, -- enables an input dialog for inc-rename.nvim
+ lsp_doc_border = false, -- add a border to hover docs and signature help
+ },
+ popupmenu = {
+ enabled = true,
+ backend = "nui",
+ },
+ views = {
+ cmdline_popup = {
+ position = {
+ row = 5,
+ col = '50%',
+ },
+ size = {
+ width = 60,
+ height = 'auto',
+ },
+ },
+ popupmenu = {
+ relative = 'editor',
+ position = {
+ row = 8,
+ col = '50%',
+ },
+ size = {
+ width = 60,
+ height = 10,
+ },
+ border = {
+ style = 'rounded',
+ padding = { 0, 1 },
+ },
+ win_options = {
+ winhighlight = { Normal = 'Normal', FloatBorder = 'DiagnosticInfo' },
+ },
+ },
+ },
+ routes = {
+ {
+ filter = {
+ event = 'lsp',
+ kind = 'progress',
+ cond = function(message)
+ local client = vim.tbl_get(message.opts, 'progress', 'client')
+ return client == 'null-ls'
+ end,
+ },
+ opts = {
+ skip = true,
+ },
+ },
+ {
+ filter = {
+ event = 'msg_show',
+ kind = '',
+ find = 'written',
+ },
+ opts = {
+ skip = true,
+ },
+ },
+ },
+ },
+ dependencies = {
+ -- if you lazy-load any plugin below, make sure to add proper `module='...'` entries
+ 'MunifTanjim/nui.nvim',
+ -- OPTIONAL:
+ -- `nvim-notify` is only needed, if you want to use the notification view.
+ -- If not available, we use `mini` as the fallback
+ 'rcarriga/nvim-notify',
+ },
+ },
+}
diff --git a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
index f0a4f95..fb7aaab 100644
--- a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
+++ b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
@@ -40,6 +40,17 @@ return {
local cmp = require('cmp')
local lspkind = require('lspkind')
cmp.setup({
+ enabled = function()
+ -- disable completion in comments
+ local context = require 'cmp.config.context'
+ -- keep command mode completion enabled when cursor is in a comment
+ if vim.api.nvim_get_mode().mode == 'c' then
+ return true
+ else
+ return not context.in_treesitter_capture("comment")
+ and not context.in_syntax_group("Comment")
+ end
+ end,
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
@@ -88,10 +99,18 @@ return {
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
+ view = {
+ entries = { name = 'wildmenu', separator = '|' },
+ },
sources = cmp.config.sources({
{ name = 'path' }
}, {
- { name = 'cmdline' }
+ {
+ name = 'cmdline',
+ option = {
+ ignore_cmds = { 'Man', '!' },
+ },
+ },
})
})
end,
diff --git a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua
index 48a86c6..775dd7a 100644
--- a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua
+++ b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua
@@ -1,15 +1,21 @@
return {
{
+ dependencies = {
+ { 'williamboman/mason.nvim' },
+ { 'williamboman/mason-lspconfig.nvim' },
+ },
'neovim/nvim-lspconfig',
lazy = false,
priority = 800,
config = function()
+ require("mason").setup()
+ require("mason-lspconfig").setup()
local nvim_lsp = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { "bashls", "clangd", "cssls", "dockerls", "gopls", "htmx", "jsonls", "marksman",
- "phpactor", "psalm", "ruff", "rust_analyzer", "taplo", "yamlls" }
+ "ruff", "rust_analyzer", "taplo", "yamlls" }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
capabilities = capabilities,
@@ -112,6 +118,17 @@ return {
flags = {
debounce_text_changes = 150,
},
+
+ require 'lspconfig'.intelephense.setup {
+ filetypes = { 'php' },
+ capabilities = capabilities,
+ flags = {
+ debounce_text_changes = 150,
+ },
+ init_options = {
+ licenceKey = '~/.config/intelephense/licence.txt',
+ },
+ }
}
-- Use LspAttach autocommand to only map the following keys
diff --git a/neovim/.config/nvim/lua/plugins/tabby.lua b/neovim/.config/nvim/lua/plugins/tabby.lua
index 0aa271e..b51c859 100644
--- a/neovim/.config/nvim/lua/plugins/tabby.lua
+++ b/neovim/.config/nvim/lua/plugins/tabby.lua
@@ -4,6 +4,7 @@ return {
dependencies = {
'nvim-tree/nvim-web-devicons',
},
+ cond = function() return vim.fn.has('gui_running') == 0 end,
config = function()
local theme = {
fill = 'TabLineFill',
diff --git a/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua b/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua
new file mode 100644
index 0000000..edcf7b6
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua
@@ -0,0 +1,6 @@
+return {
+ {
+ 'leafOfTree/vim-svelte-plugin',
+ ft = 'svelte',
+ }
+}