summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/ghostty/config9
-rw-r--r--.config/nvim/init.lua25
-rw-r--r--.config/nvim/lua/lines.lua112
-rw-r--r--.config/nvim/lua/lsp.lua30
-rw-r--r--.config/nvim/lua/set.lua79
-rw-r--r--.config/xdg-terminals.list1
6 files changed, 23 insertions, 233 deletions
diff --git a/.config/ghostty/config b/.config/ghostty/config
new file mode 100644
index 0000000..d70c88a
--- /dev/null
+++ b/.config/ghostty/config
@@ -0,0 +1,9 @@
+font-family = ""
+font-family = "Adwaita Mono"
+
+theme = dark:Adwaita Dark,light:Adwaita
+shell-integration-features = false
+gtk-single-instance = true
+linux-cgroup = always
+window-theme = ghostty
+window-subtitle = working-directory
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 2d516ab..597d757 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -27,8 +27,14 @@ vim.o.mouse = 'a'
vim.o.foldcolumn = "auto"
vim.o.cursorline = true
vim.o.laststatus = 2
-vim.o.statusline = "%!v:lua.require'lines'.status()"
-vim.o.tabline = "%!v:lua.require'lines'.tab()"
+vim.o.statusline = table.concat({
+ '%<%n:',
+ '%f %h%w%m%r%y ',
+ '%=',
+ "%{% &showcmdloc == 'statusline' ? '%-10.S ' : '' %}",
+ "%{% exists('b:keymap_name') ? '<'..b:keymap_name..'> ' : '' %}",
+ "%{% &ruler ? ( &rulerformat == '' ? '%-14.(%l,%c%V%) %P' : &rulerformat ) : '' %}",
+ })
vim.o.signcolumn = 'yes'
vim.o.completeopt = "menuone,noselect,popup,fuzzy"
@@ -36,8 +42,6 @@ vim.o.showtabline = 2
vim.o.exrc = true
-vim.cmd.colorscheme 'retrobox'
-
vim.keymap.set({ 'n', 'x' }, '<leader>y', '"+y')
vim.keymap.set('n', '<leader>p', '"+p')
vim.keymap.set('x', '<leader>p', '"+P')
@@ -49,19 +53,6 @@ vim.keymap.set('n', '<Esc>', function()
vim.cmd.nohlsearch()
end)
-vim.keymap.set('n', '<leader>t', function()
- vim.cmd.split()
- vim.cmd.terminal()
-end)
-
-vim.keymap.set('n', '<leader>o', function()
- vim.cmd.Lexplore()
-end)
-
-vim.keymap.set('n', '<leader>O', function()
- vim.cmd.Lexplore(vim.fn.expand "%:p:h")
-end)
-
for _, value in ipairs({
'<Up>', '<Up>', '<Down>', '<Left>', '<Right>',
'<Home>', '<End>', '<PageUp>', '<PageDown>'
diff --git a/.config/nvim/lua/lines.lua b/.config/nvim/lua/lines.lua
deleted file mode 100644
index 3e0b539..0000000
--- a/.config/nvim/lua/lines.lua
+++ /dev/null
@@ -1,112 +0,0 @@
----@class Line
-local line = {}
-
----@param buffer integer
----@return string
-function line.get_formated_bufname(buffer)
- buffer = buffer or 0
-
- local name = vim.api.nvim_buf_get_name(buffer)
- local buftype = vim.bo[buffer].buftype
- if buftype == "terminal" then
- name = vim.b[buffer].term_title
- else
- if #name == 0 then
- name = '[No Name] (' .. (buftype or vim.bo[buffer].filetype) .. ')'
- end
- local modified = vim.bo[buffer].modified and '[+]' or ""
- local readonly = vim.bo[buffer].readonly and '[RO]' or ""
- name = name .. modified .. readonly
- end
-
- return name
-end
-
----@return string
-function line.status()
- local window = vim.g.statusline_winid
- local fillchar
- if window == vim.api.nvim_get_current_win() then
- fillchar = vim.opt.fillchars:get()["stl"]
- else
- fillchar = vim.opt.fillchars:get()["stlnc"]
- end
-
- if fillchar == nil then
- fillchar = " "
- end
-
- local buffer = vim.api.nvim_win_get_buf(window)
- local buftype = vim.bo[buffer].buftype
-
-
- if buftype == "terminal" then
- return table.concat({ vim.b[buffer].term_title, vim.api.nvim_buf_get_name(buffer) }, '%=')
- end
-
- if vim.bo[buffer].filetype == "netrw"
- then
- return "%f"
- end
-
- -- return '%=%-11.S%k%-14.(%l,%c%V%) %P'
- local ruler = ""
- if vim.o.ruler then
- ruler = vim.o.rulerformat
- if #ruler == 0 then
- ruler = "%-14.(%l:%c%V%)" .. fillchar .. "%P"
- end
- end
-
- local clients = {}
- for _, client in ipairs(vim.lsp.get_clients()) do
- if client.attached_buffers[buffer] then
- table.insert(clients, client.name)
- end
- end
-
- local cli = ""
- if #clients ~= 0 then
- cli = "(" .. table.concat(clients, ", ") .. ")"
- end
-
- return table.concat({
- '%<%f',
- '%h%w%m%r',
- "%=",
- vim.bo[buffer].filetype,
- cli,
- vim.bo[buffer].spelllang,
- vim.bo[buffer].fileencoding,
- vim.bo[buffer].fileformat,
- '%-12.k',
- '%S',
- ruler
- }, fillchar)
-end
-
----@return string
-function line.tab()
- local tabs = vim.api.nvim_list_tabpages()
- local format = vim.tbl_map(function(tab)
- local str = ""
- if tab == vim.api.nvim_get_current_tabpage() then
- str = '%#TabLineSel#'
- else
- str = '%#TabLine#'
- end
- local buffer = vim.api.nvim_win_get_buf(vim.api.nvim_tabpage_get_win(tab))
- return
- table.concat {
- str,
- "%", tab, 'T',
- line.get_formated_bufname(buffer),
- " %", tab, 'XX'
- }
- end, tabs)
- local tabline = table.concat(format, " ")
-
- return tabline .. '%#TabLineFill#%T'
-end
-
-return line
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua
index 4b5fe02..418179b 100644
--- a/.config/nvim/lua/lsp.lua
+++ b/.config/nvim/lua/lsp.lua
@@ -2,31 +2,7 @@
---@param client vim.lsp.Client
---@param buf integer
function Lsp(client, buf)
- vim.keymap.set('n', '<leader>f', function()
- vim.lsp.buf.format { async = true }
- end, { buffer = buf })
-
- vim.api.nvim_buf_create_user_command(buf, "Format", function(args)
- local range = nil
- if args.count ~= -1 then
- local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
- range = {
- start = { args.line1, 0 },
- ["end"] = { args.line2, end_line:len() },
- }
- end
- vim.lsp.buf.format { async = true, range = range, bufnr = buf }
- end, { range = true })
-
- vim.keymap.set('n', '<leader>wa', function()
- vim.lsp.buf.add_workspace_folder()
- end, { buffer = buf })
-
- vim.keymap.set('n', '<leader>wr', function()
- vim.lsp.buf.remove_workspace_folder()
- end, { buffer = buf })
-
- vim.keymap.set('n', '<leader>wl', function()
+ vim.keymap.set('n', 'gwl', function()
local dir = vim.lsp.buf.list_workspace_folders()
vim.ui.select(dir, {
prompt = 'Workspace Dir: ',
@@ -37,6 +13,10 @@ function Lsp(client, buf)
end)
end, { buffer = buf })
+ vim.keymap.set('n', 'grt', function()
+ vim.lsp.buf.type_definition()
+ end, { desc = 'vim.lsp.buf.type_definition()' })
+
vim.api.nvim_buf_create_user_command(buf, "Symbols", function(args)
if args.args == ""
then
diff --git a/.config/nvim/lua/set.lua b/.config/nvim/lua/set.lua
deleted file mode 100644
index 1e829d5..0000000
--- a/.config/nvim/lua/set.lua
+++ /dev/null
@@ -1,79 +0,0 @@
----@class Set
----@field elements table<any, boolean>
-Set = {}
-Set.__index = Set
-
---- Constructor for creating a new set
----@param initialList table|nil -- Accepts a table (list) or nil for empty set
----@return Set
-function Set:new(initialList)
- local instance = setmetatable({}, self)
- instance.elements = {}
-
- -- Populate the set with elements from initialList if provided
- if initialList then
- for _, element in ipairs(initialList) do
- instance:add(element)
- end
- end
-
- return instance
-end
-
---- Add an element to the set
----@param element any
-function Set:add(element)
- self.elements[element] = true -- Setting key to true enforces uniqueness
-end
-
---- Remove an element from the set
----@param element any
-function Set:remove(element)
- self.elements[element] = nil
-end
-
----Check if the set contains an element
----@param element any
-function Set:has(element)
- return self.elements[element] ~= nil
-end
-
----Union operation: combines two sets
----@param otherSet Set
----@return Set
-function Set:union(otherSet)
- local resultSet = Set:new()
- for key in pairs(self.elements) do
- resultSet:add(key)
- end
- for key in pairs(otherSet.elements) do
- resultSet:add(key)
- end
- return resultSet
-end
-
--- Intersection operation: elements common to both sets
-function Set:intersection(otherSet)
- local resultSet = Set:new()
- for key in pairs(self.elements) do
- if otherSet:contains(key) then
- resultSet:add(key)
- end
- end
- return resultSet
-end
-
--- Difference operation: elements in this set but not in otherSet
----@param otherSet Set
----@return Set
-function Set:difference(otherSet)
- local resultSet = Set:new()
- for key in pairs(self.elements) do
- if not otherSet:has(key) then
- resultSet:add(key)
- end
- end
- return resultSet
-end
-
-return Set
diff --git a/.config/xdg-terminals.list b/.config/xdg-terminals.list
new file mode 100644
index 0000000..fd2841d
--- /dev/null
+++ b/.config/xdg-terminals.list
@@ -0,0 +1 @@
+com.mitchellh.ghostty.desktop