Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions AmazonQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Neovim Configuration Debugging

## Issues Fixed

1. **Noice.nvim Plugin Error**
- Problem: Error in `noice.nvim/lua/noice/util/lazy.lua:13: attempt to index field 'loaded' (a nil value)`
- Solution: Created a custom configuration for noice.nvim with proper error handling and dependencies

2. **CSS Language Server Errors**
- Problem: Multiple "MethodNotFound" errors for "workspace/diagnostic/refresh"
- Solution: Added a custom handler to the cssls configuration to properly handle this method

3. **LSP Configuration Error**
- Problem: "Setup `require(\"neoconf\").setup()` should be run **BEFORE** setting up any lsp server with lspconfig"
- Solution: Added neoconf.nvim and neodev.nvim as dependencies with proper configuration

## Configuration Changes

1. Created `/Users/iforster/myenv/neovim/.config/nvim/lua/iforster/plugins/noice.lua` with proper initialization and error handling
2. Modified `/Users/iforster/myenv/neovim/.config/nvim/lua/iforster/plugins/lsp/lspconfig.lua` to add a handler for the CSS language server
3. Updated `/Users/iforster/myenv/neovim/.config/nvim/lua/iforster/plugins/lsp/init.lua` to ensure proper loading order
4. Added neoconf.nvim and neodev.nvim as dependencies to lspconfig.lua with proper configuration

## Next Steps

1. Restart Neovim to test the changes
2. Run `:checkhealth` to verify all plugins are working correctly
3. If issues persist, check the logs again at `~/.local/state/nvim/log` and `~/.local/state/nvim/lsp.log`

## Additional Recommendations

1. Consider updating plugins with `:Lazy update` to ensure you have the latest versions
2. If you encounter issues with specific language servers, try reinstalling them with `:Mason`
3. For persistent issues with noice.nvim, consider temporarily disabling it to isolate other problems
4. Consider installing the Python neovim module with `pip install neovim` to resolve Python provider warnings
2 changes: 1 addition & 1 deletion lua/iforster/core/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require("iforster.core.fonts")
require("iforster.core.options")
require("iforster.core.fonts")
require("iforster.core.keymaps")
--require("iforster.core.colorscheme")
2 changes: 1 addition & 1 deletion lua/iforster/core/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local keymap = vim.keymap -- for consiceness

-- general keymaps

keymap.set("i", "jk", "<ESC>")
keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode with jk" })

keymap.set("n", "<leader>nh", ":nohl<CR>")

Expand Down
41 changes: 22 additions & 19 deletions lua/iforster/core/options.lua
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
local opt = vim.opt -- for conciseness
vim.cmd("let g:netrw_liststyle = 3")

local opt = vim.opt

vim.cmd("let g:netrw_liststyle = 3")

-- line numbers
opt.relativenumber = true
opt.number = true

-- tabs & indentation
opt.tabstop = 2
opt.shiftwidth = 2
opt.expandtab = true
opt.autoindent = true
-- tab & indentation
opt.tabstop = 2 -- 2 spaces for tabs (prettier default)
opt.shiftwidth = 2 -- 2 spaces for shiftwidth
opt.expandtab = true -- expand tab to spaces
opt.autoindent = true -- copy indent from current line when starting a new one

-- line wrapping
opt.wrap = false

-- search settings
opt.ignorecase = true
opt.smartcase = true
opt.ignorecase = true --ignore case when searching
opt.smartcase = true -- if you use mixed case in search, assumes you want case insensitive search

-- cursor line
opt.cursorline = true

-- appearance
-- turn on termguicolors for tokyonight colorscheme to work
-- (have to use iterm2 or any other true color terminal)
opt.termguicolors = true
opt.background = "dark"
opt.signcolumn = "yes"
opt.background = "dark" -- colorschemes that can be light or dark will be made dark
opt.signcolumn = "yes" -- show sign column so that text doesn't shift

-- backspace
opt.backspace = "indent,eol,start"
opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position

-- clipboard
opt.clipboard:append("unnamedplus")
opt.clipboard:append("unnamedplus") -- use system clipboard as default register

-- split windows
opt.splitright = true
opt.splitbelow = true
opt.splitright = true -- split vertical window to the right
opt.splitbelow = true -- split horizontal window to the bottom

opt.iskeyword:append("-")
-- turn off swapfile
opt.swapfile = false
44 changes: 15 additions & 29 deletions lua/iforster/lazy.lua
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "iforster.plugins" },
{ import = "iforster.plugins.lsp" },
},

-- import any extras modules here
-- { import = "lazyvim.plugins.extras.lang.typescript" },
-- { import = "lazyvim.plugins.extras.lang.json" },
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
}, {
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
require("lazy").setup({ { import = "iforster.plugins" }, { import = "iforster.plugins.lsp" } }, { checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})
54 changes: 54 additions & 0 deletions lua/iforster/plugins/alpha.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
return {
"goolord/alpha-nvim",
lazy = false,
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = function()
local dashboard = require("alpha.themes.dashboard")

-- Custom header (ASCII art)
dashboard.section.header.val = {
" ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z",
" ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z ",
" ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z ",
" ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z ",
" ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
" Customized by Ian Forster",
}

-- Buttons (center actions)
dashboard.section.buttons.val = {
dashboard.button("SPC ff", "󰱼 Find File", "<cmd>Telescope find_files<CR>"),
dashboard.button("n", " New File", ":ene | startinsert <CR>"),
dashboard.button("r", " Recent Files", ":Telescope oldfiles <CR>"),
dashboard.button("g", " Find Text", ":Telescope live_grep <CR>"),
dashboard.button("s", " Restore Session", ":lua require('persistence').load()<CR>"),
dashboard.button("x", " Lazy Extras", ":LazyExtras <CR>"),
dashboard.button("l", "󰒲 Lazy", ":Lazy <CR>"),
dashboard.button("q", " Quit", ":qa<CR>"),
}

-- Footer with plugin stats
dashboard.section.footer.val = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end

dashboard.opts.layout[1].val = 8 -- Top padding (similar to `string.rep("\n", 8)`)

vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
callback = function()
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.schedule(function()
require("lazy").show()
end)
end
end,
})

return dashboard.opts
end,
}
16 changes: 16 additions & 0 deletions lua/iforster/plugins/auto-session.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
return {
"rmagatti/auto-session",
config = function()
local auto_session = require("auto-session")

auto_session.setup({
auto_restore_enabled = false,
auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" },
})

local keymap = vim.keymap

keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory
end,
}
50 changes: 25 additions & 25 deletions lua/iforster/plugins/autopairs.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
return {
"windwp/nvim-autopairs",
"hrsh7th/nvim-cmp",
event = { "InsertEnter" },
dependencies = {
"hrsh7th/nvim-cmp",
},
config = function()
--import nvim-autopairs
local autopairs = require("nvim-autopairs")
"windwp/nvim-autopairs",
event = { "InsertEnter" },
dependencies = {
"hrsh7th/nvim-cmp",
},
config = function()
-- import nvim-autopairs
local autopairs = require("nvim-autopairs")

-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
})
-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
})

-- import nvim-autopairs completion functionality
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- import nvim-autopairs completion functionality
local cmp_autopairs = require("nvim-autopairs.completion.cmp")

-- import nvim-cmp plugin (completions plugin)
local cmp = require("cmp")
-- import nvim-cmp plugin (completions plugin)
local cmp = require("cmp")

-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
}

10 changes: 10 additions & 0 deletions lua/iforster/plugins/bufferline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
"akinsho/bufferline.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
version = "*",
opts = {
options = {
mode = "tabs",
},
},
}
45 changes: 45 additions & 0 deletions lua/iforster/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
return {
"folke/tokyonight.nvim",
priority = 1000,
config = function()
local transparent = false -- set to true if you would like to enable transparency

local bg = "#011628"
local bg_dark = "#011423"
local bg_highlight = "#143652"
local bg_search = "#0A64AC"
local bg_visual = "#275378"
local fg = "#CBE0F0"
local fg_dark = "#B4D0E9"
local fg_gutter = "#627E97"
local border = "#547998"

require("tokyonight").setup({
style = "night",
transparent = transparent,
styles = {
sidebars = transparent and "transparent" or "dark",
floats = transparent and "transparent" or "dark",
},
on_colors = function(colors)
colors.bg = bg
colors.bg_dark = transparent and colors.none or bg_dark
colors.bg_float = transparent and colors.none or bg_dark
colors.bg_highlight = bg_highlight
colors.bg_popup = bg_dark
colors.bg_search = bg_search
colors.bg_sidebar = transparent and colors.none or bg_dark
colors.bg_statusline = transparent and colors.none or bg_dark
colors.bg_visual = bg_visual
colors.border = border
colors.fg = fg
colors.fg_dark = fg_dark
colors.fg_float = fg
colors.fg_gutter = fg_gutter
colors.fg_sidebar = fg_dark
end,
})

vim.cmd("colorscheme tokyonight")
end,
}
19 changes: 19 additions & 0 deletions lua/iforster/plugins/comment.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
return {
"numToStr/Comment.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
-- import comment plugin safely
local comment = require("Comment")

local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")

-- enable comment
comment.setup({
-- for commenting tsx, jsx, svelte, html files
pre_hook = ts_context_commentstring.create_pre_hook(),
})
end,
}
4 changes: 2 additions & 2 deletions lua/iforster/plugins/core.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
return {
{ "folke/lazy.nvim", version = false },
{ "LazyVim/LazyVim", version = false },
{ "folke/lazy.nvim", version = false },
{ "LazyVim/LazyVim", version = false },
}
4 changes: 4 additions & 0 deletions lua/iforster/plugins/dressing.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
}
Loading