Many changes

This commit is contained in:
Fabian Becker
2024-01-24 12:17:33 -05:00
parent 5782602a20
commit 49caa17eef
14 changed files with 566 additions and 102 deletions

View File

@@ -3,6 +3,7 @@ local Remap = require("halfdan.keymap")
local nnoremap = Remap.nnoremap
local vnoremap = Remap.vnoremap
local inoremap = Remap.inoremap
local tnoremap = Remap.tnoremap
local xnoremap = Remap.xnoremap
local nmap = Remap.nmap
@@ -38,6 +39,9 @@ nnoremap('<A-l>', '<C-w>l')
nnoremap('<leader>th', '<C-w>t<C-w>H')
nnoremap('<leader>tk', '<C-w>t<C-w>K')
nnoremap("<leader>\\", ":vsplit<CR>")
nnoremap("<leader>/", ":split<CR>")
-- Keybindings below this are neovim cli only
if vim.g.vscode then
-- Toggle Comment
@@ -49,6 +53,9 @@ if vim.g.vscode then
return
end
tnoremap('<ESC>', '<C-\\><C-n>')
nnoremap('<C-B>', ':Neotree right toggle<CR>')
-- resize with arrows
nnoremap('<C-Up>', ':resize -2<CR>')
nnoremap('<C-Down>', ':resize +2<CR>')

View File

@@ -218,7 +218,7 @@ require('rust-tools').setup({
local lexical_config = {
filetypes = { "elixir", "eelixir", "heex" },
cmd = { "/Users/halfdan/code/lexical/_build/dev/package/lexical/bin/start_lexical.sh" },
cmd = { "/Users/fbecker/code/lexical/_build/dev/package/lexical/bin/start_lexical.sh" },
settings = {},
}

View File

@@ -1,51 +0,0 @@
if vim.g.vscode then
return
end
local function get_file_name(include_path)
local file_name = require('lspsaga.symbolwinbar').get_file_name()
if vim.fn.bufname '%' == '' then return '' end
if include_path == false then return file_name end
-- Else if include path: ./lsp/saga.lua -> lsp > saga.lua
local sep = vim.loop.os_uname().sysname == 'Windows' and '\\' or '/'
local path_list = vim.split(string.gsub(vim.fn.expand '%:~:.:h', '%%', ''), sep)
local file_path = ''
for _, cur in ipairs(path_list) do
file_path = (cur == '.' or cur == '~') and '' or
file_path .. cur .. ' ' .. '%#LspSagaWinbarSep#>%*' .. ' %*'
end
return file_path .. file_name
end
local function config_winbar()
local exclude = {
['teminal'] = true,
['toggleterm'] = true,
['prompt'] = true,
['NvimTree'] = true,
['help'] = true,
} -- Ignore float windows and exclude filetype
if vim.api.nvim_win_get_config(0).zindex or exclude[vim.bo.filetype] then
vim.wo.winbar = ''
else
local ok, lspsaga = pcall(require, 'lspsaga.symbolwinbar')
local sym
if ok then sym = lspsaga.get_symbol_node() end
local win_val = ''
win_val = get_file_name(true) -- set to true to include path
if sym ~= nil then win_val = win_val .. sym end
vim.wo.winbar = win_val
end
end
-- local events = { 'BufEnter', 'BufWinEnter', 'CursorMoved' }
--
-- vim.api.nvim_create_autocmd(events, {
-- pattern = '*',
-- callback = function() config_winbar() end,
-- })
--
-- vim.api.nvim_create_autocmd('User', {
-- pattern = 'LspsagaUpdateSymbol',
-- callback = function() config_winbar() end,
-- })