Skip to content
Merged
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
5 changes: 3 additions & 2 deletions ghostty/config
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
# on Ghostty's website, at https://ghostty.org/docs/config.

font-family = JetBrainsMono NFM Medium
theme = Catppuccin Macchiato
theme = Catppuccin Frappe
# theme = dark:Catppuccin Frappe,light:Catppuccin Latte


background-opacity = 0.95

window-width = 160
window-height = 45
window-padding-x = 4
window-padding-y = 4

4 changes: 0 additions & 4 deletions nvim/.luarc.json

This file was deleted.

18 changes: 18 additions & 0 deletions nvim/after/lsp/lua_ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
return {
settings = {
Lua = {
runtime = { version = 'LuaJIT' },
diagnostics = {
globals = { 'vim' },
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
'${3rd}/luv/library',
},
},
telemetry = { enable = false },
},
},
}
21 changes: 13 additions & 8 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@
-- neovim standard paths:
-- https://neovim.io/doc/user/starting.html#standard-path

if vim.fn.has("nvim-0.11.0") == 0 then
local minVer = '0.12.0'
if vim.fn.has("nvim-" .. minVer) == 0 then
vim.api.nvim_echo({
{ "This nvim config requires neovim >= 0.11.0\n", "ErrorMsg" },
{ "This nvim config requires neovim >= " .. minVer .. "\n", "ErrorMsg" },
{ "Press any key to exit", "MoreMsg" },
}, true, {})
vim.fn.getchar()
vim.cmd([[quit]])
return {}
end

require('options')
require('keymaps')
require('autocmds')
require('lazy-nvim')
require('lsp-config')
require('vim._core.ui2').enable()

-- set leader before loading plugins
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

require("options")
require("pack")
require("lsp")
require("commands")

vim.cmd[[ colorscheme catppuccin-macchiato ]]
24 changes: 0 additions & 24 deletions nvim/lazy-lock.json

This file was deleted.

9 changes: 0 additions & 9 deletions nvim/lua/autocmds.lua

This file was deleted.

40 changes: 40 additions & 0 deletions nvim/lua/commands.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
local api = vim.api
local opt = vim.opt

local augroup = api.nvim_create_augroup("user.commands", { clear = true })

api.nvim_create_autocmd("TextYankPost", {
group = augroup,
pattern = "*",
desc = "Highlight when yanking (copying) text",
callback = function()
vim.hl.on_yank()
end,
})

api.nvim_create_autocmd("WinEnter", {
group = augroup,
pattern = "*",
callback = function()
Comment thread
davidjenni marked this conversation as resolved.
local function count_non_floating_wins()
local count = 0
for _, win in ipairs(api.nvim_tabpage_list_wins(0)) do
local cfg = api.nvim_win_get_config(win)
if cfg.relative == "" then -- Empty means it's not floating
count = count + 1
end
end
return count
end

local locWins = count_non_floating_wins()
if locWins > 1 then
opt.winbar = "%f %m"
else
opt.winbar = ""
end
end
})



31 changes: 0 additions & 31 deletions nvim/lua/keymaps.lua

This file was deleted.

26 changes: 0 additions & 26 deletions nvim/lua/lazy-nvim.lua

This file was deleted.

37 changes: 0 additions & 37 deletions nvim/lua/lsp-config.lua

This file was deleted.

120 changes: 120 additions & 0 deletions nvim/lua/lsp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
local cmd = vim.cmd
local set = vim.keymap.set
local diag = vim.diagnostic

-- diagnostics:
diag.config({
-- float = {
-- border = 'rounded',
-- source = 'if_many',
-- },
severity_sort = true,
virtual_text = {
prefix = '●',
source = 'if_many',
spacing = 6,
},
signs = {
active = true,
text = {
[vim.diagnostic.severity.ERROR] = "󰅚", -- icon for error
[vim.diagnostic.severity.WARN] = "󰀪", -- icon for warning
[vim.diagnostic.severity.INFO] = "󰋽", -- icon for info
[vim.diagnostic.severity.HINT] = "󰌶", -- icon for hint
},
},
})

require('mason-lspconfig').setup({
ensure_installed = { 'jsonls', 'lua_ls', 'roslyn_ls', 'rust_analyzer' },
})
-- local toolsToInstall = { 'stylua' }
local toolsToInstall = { }
for _, tool in ipairs(toolsToInstall) do
if vim.fn.executable(tool) == 0 then
cmd([[MasonInstall ]] .. tool)
end
end

set("n", "<leader>q", function()
diag.setloclist({ open = true })
end, { desc = "Open diagnostic list" })

vim.lsp.enable({ 'jsonls', 'lua_ls' })

vim.o.autocomplete = false

vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('my.lsp', {}),
callback = function(ev)
local client = assert(vim.lsp.get_client_by_id(ev.data.client_id))
-- if client:supports_method('textDocument/implementation') then
-- -- Create a keymap for vim.lsp.buf.implementation ...
-- end

if client:supports_method('textDocument/completion') then
vim.lsp.completion.enable(true, client.id, ev.buf, {autotrigger = false})

local function feedkeys(keys)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(keys, true, false, true), 'n', true)
end

local function pumvisible()
return tonumber(vim.fn.pumvisible()) ~= 0
end

-- vim.lsp.handlers["textDocument/hover"] = function(_, _, _, config)
-- config = config or {}
-- config.border = 'rounded'
-- vim.lsp.buf.signature_help( { config })
-- end
set("i", "<c-space>", function() vim.lsp.completion.get() end, { desc = 'Start completion popup menu'})

set('i', '<cr>', function()
if pumvisible() then feedkeys '<C-y>' else feedkeys '<cr>' end
end, { desc = 'Accept current selected completion' })

set('i', '/', function()
if pumvisible() then feedkeys '<C-e>' else feedkeys '/' end
end, { desc = 'Dismiss completion menu' })

-- LSP key mappings:
set('i', '<C-u>', '<C-x><C-n>', { desc = 'Buffer completions' })

set({ 'i', 's' }, '<Tab>', function()
if pumvisible() then
feedkeys '<C-n>'
elseif vim.snippet.active { direction = 1 } then
vim.snippet.jump(1)
else
feedkeys '<Tab>'
end
end, { desc = 'Select next completion' })

set({ 'i', 's' }, '<S-Tab>', function()
if pumvisible() then
feedkeys '<C-p>'
elseif vim.snippet.active { direction = -1 } then
vim.snippet.jump(-1)
else
feedkeys '<S-Tab>'
end
end, { desc = 'Select previous completion' })

-- Inside a snippet, use backspace to remove the placeholder.
set('s', '<BS>', '<C-o>s', { desc = 'Remove snippet placeholder' })
end

-- Auto-format ("lint") on save.
-- if not client:supports_method('textDocument/willSaveWaitUntil')
-- and client:supports_method('textDocument/formatting') then
-- vim.api.nvim_create_autocmd('BufWritePre', {
-- group = vim.api.nvim_create_augroup('my.lsp', {clear=false}),
-- buffer = ev.buf,
-- callback = function()
-- vim.lsp.buf.format({ bufnr = ev.buf, id = client.id, timeout_ms = 1000 })
-- end,
-- })
-- end
end,
})
Loading
Loading