fixed keybinds
This commit is contained in:
parent
814895b1ca
commit
0d7cd965a3
@ -48,18 +48,26 @@ M.ui = {
|
||||
|
||||
-- nvdash (dashboard)
|
||||
nvdash = {
|
||||
load_on_startup = false,
|
||||
load_on_startup = true,
|
||||
|
||||
header = {
|
||||
" ▄ ▄ ",
|
||||
" ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ",
|
||||
" █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ",
|
||||
" ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ",
|
||||
" ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
|
||||
" █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄",
|
||||
"▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █",
|
||||
"█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █",
|
||||
" █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ",
|
||||
" ____________________",
|
||||
"/ \\",
|
||||
"| In case of |",
|
||||
"| Frustration |",
|
||||
"\\____________________/",
|
||||
" ! !",
|
||||
" ! !",
|
||||
" L_ !",
|
||||
" / _)!",
|
||||
" / /__L",
|
||||
" _____/ (____)",
|
||||
" (____)",
|
||||
" _____ (____)",
|
||||
" \\_(____)",
|
||||
" ! !",
|
||||
" ! !",
|
||||
" \\__/",
|
||||
},
|
||||
|
||||
buttons = {
|
||||
|
||||
@ -4,10 +4,6 @@ local M = {}
|
||||
|
||||
M.general = {
|
||||
i = {
|
||||
-- go to beginning and end
|
||||
["<C-b>"] = { "<ESC>^i", "Beginning of line" },
|
||||
["<C-e>"] = { "<End>", "End of line" },
|
||||
|
||||
-- navigate within insert mode
|
||||
["<C-h>"] = { "<Left>", "Move left" },
|
||||
["<C-l>"] = { "<Right>", "Move right" },
|
||||
|
||||
@ -1,7 +1,90 @@
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.ui = { theme = 'one_light' }
|
||||
M.plugins = 'custom.plugins'
|
||||
M.ui = {
|
||||
------------------------------- base46 -------------------------------------
|
||||
-- hl = highlights
|
||||
hl_add = {},
|
||||
hl_override = {},
|
||||
changed_themes = {},
|
||||
theme_toggle = { "dark_horizon", "one_light" },
|
||||
theme = "dark_horizon", -- default theme
|
||||
transparency = false,
|
||||
lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens
|
||||
|
||||
-- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations
|
||||
extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify"
|
||||
|
||||
-- cmp themeing
|
||||
cmp = {
|
||||
icons = true,
|
||||
lspkind_text = true,
|
||||
style = "default", -- default/flat_light/flat_dark/atom/atom_colored
|
||||
border_color = "grey_fg", -- only applicable for "default" style, use color names from base30 variables
|
||||
selected_item_bg = "colored", -- colored / simple
|
||||
},
|
||||
|
||||
telescope = { style = "borderless" }, -- borderless / bordered
|
||||
|
||||
------------------------------- nvchad_ui modules -----------------------------
|
||||
statusline = {
|
||||
theme = "default", -- default/vscode/vscode_colored/minimal
|
||||
-- default/round/block/arrow separators work only for default statusline theme
|
||||
-- round and block will work for minimal theme only
|
||||
separator_style = "default",
|
||||
overriden_modules = nil,
|
||||
},
|
||||
|
||||
-- lazyload it when there are 1+ buffers
|
||||
tabufline = {
|
||||
show_numbers = false,
|
||||
enabled = true,
|
||||
lazyload = true,
|
||||
overriden_modules = nil,
|
||||
},
|
||||
|
||||
-- nvdash (dashboard)
|
||||
nvdash = {
|
||||
load_on_startup = true,
|
||||
|
||||
header = {
|
||||
" ____________________ ",
|
||||
"/ \\ ",
|
||||
"| In case of | ",
|
||||
"| Frustration | ",
|
||||
"\\____________________/ ",
|
||||
" ! ! ",
|
||||
" ! ! ",
|
||||
" L_ ! ",
|
||||
" / _)! ",
|
||||
" / /__L ",
|
||||
" _____/ (____) ",
|
||||
" (____) ",
|
||||
" _____ (____) ",
|
||||
" \\_(____) ",
|
||||
" ! ! ",
|
||||
" ! ! ",
|
||||
" \\__/ ",
|
||||
},
|
||||
|
||||
buttons = {
|
||||
{ " Find File", "Spc f f", "Telescope find_files" },
|
||||
{ " Recent Files", "Spc f o", "Telescope oldfiles" },
|
||||
{ " Find Sessions", "Spc f s", "Telescope Sessions" },
|
||||
},
|
||||
},
|
||||
|
||||
cheatsheet = { theme = "grid" }, -- simple/grid
|
||||
|
||||
lsp = {
|
||||
-- show function signatures i.e args as you type
|
||||
signature = {
|
||||
disabled = false,
|
||||
silent = true, -- silences 'no signature help available' message from appearing
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
M.plugins = "custom.plugins"
|
||||
M.mappings = require "custom.mappings"
|
||||
return M
|
||||
|
||||
@ -65,6 +65,7 @@ lspconfig.matlab_ls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "matlab" },
|
||||
require "custom.language_specific_commands.matlab",
|
||||
}
|
||||
|
||||
lspconfig.clangd.setup {
|
||||
@ -73,17 +74,9 @@ lspconfig.clangd.setup {
|
||||
filetypes = { "c", "cpp" },
|
||||
}
|
||||
|
||||
local function marksman_on_attach(client, bufnr)
|
||||
-- Call the global version first
|
||||
on_attach(client, bufnr)
|
||||
|
||||
-- Then do the Markdown-specific logic
|
||||
-- vim.api.nvim_set_option_value("spell", true, { buf = bufnr })
|
||||
-- vim.api.nvim_set_option_value("spelllang", "en_us", { buf = bufnr })
|
||||
end
|
||||
|
||||
lspconfig.marksman.setup {
|
||||
on_attach = marksman_on_attach,
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "markdown" },
|
||||
require "custom.language_specific_commands.markdown",
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>li",
|
||||
"<leader>mi",
|
||||
"<M-i>The quick brown fox jumps over the lazy dog. The dog stays blissfully asleep. :)",
|
||||
{ desc = "Print a standard 80 character string for Markdown formatting." }
|
||||
)
|
||||
print "Markdown Keybinds Loaded"
|
||||
|
||||
@ -5,11 +5,11 @@ local matlab_term_job = nil
|
||||
-- Create the "RunMatlab" user command
|
||||
vim.api.nvim_create_user_command("RunMatlab", function()
|
||||
-- Get the absolute path of the current file
|
||||
local file = vim.fn.expand("%:p")
|
||||
local file = vim.fn.expand "%:p"
|
||||
-- Escape single quotes by doubling them for MATLAB's string literal.
|
||||
local matlab_file = file:gsub("'", "''")
|
||||
-- Construct the command to run MATLAB in batch mode, executing the current file.
|
||||
local cmd = 'matlab -batch "run(\'' .. matlab_file .. '\')"'
|
||||
local cmd = "matlab -batch \"run('" .. matlab_file .. "')\""
|
||||
|
||||
-- If we already have a MATLAB terminal and it's valid, reuse it.
|
||||
if matlab_term_buf and vim.api.nvim_buf_is_valid(matlab_term_buf) and matlab_term_job then
|
||||
@ -17,7 +17,7 @@ vim.api.nvim_create_user_command("RunMatlab", function()
|
||||
local wins = vim.fn.win_findbuf(matlab_term_buf)
|
||||
if #wins == 0 then
|
||||
-- If not visible, open it in a vertical split.
|
||||
vim.cmd("split")
|
||||
vim.cmd "split"
|
||||
vim.cmd("buffer " .. matlab_term_buf)
|
||||
else
|
||||
-- Otherwise, switch focus to that window.
|
||||
@ -27,8 +27,8 @@ vim.api.nvim_create_user_command("RunMatlab", function()
|
||||
vim.api.nvim_chan_send(matlab_term_job, cmd .. "\n")
|
||||
else
|
||||
-- If the MATLAB terminal doesn't exist, open a new vertical split terminal.
|
||||
vim.cmd("split")
|
||||
vim.cmd("terminal")
|
||||
vim.cmd "split"
|
||||
vim.cmd "terminal"
|
||||
-- Store the terminal buffer and job ID for future reuse.
|
||||
matlab_term_buf = vim.api.nvim_get_current_buf()
|
||||
matlab_term_job = vim.b.terminal_job_id
|
||||
@ -40,4 +40,6 @@ vim.api.nvim_create_user_command("RunMatlab", function()
|
||||
end, {})
|
||||
|
||||
-- Map <space>+r+m (i.e. <leader>rm) to run the MATLAB code
|
||||
vim.keymap.set("n", "<leader>rm", ":RunMatlab<CR>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<leader>mr", ":RunMatlab<CR>", { noremap = true, silent = true })
|
||||
|
||||
print "MATLAB Keybinds Loaded"
|
||||
|
||||
@ -42,11 +42,4 @@ vim.api.nvim_create_autocmd("CursorHold", {
|
||||
end,
|
||||
})
|
||||
|
||||
-- Optional: keybinding to manually show diagnostics on hover
|
||||
vim.api.nvim_set_keymap("n", "<leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true, silent = true })
|
||||
|
||||
require "custom.language_specific_commands.matlab"
|
||||
require "custom.language_specific_commands.rust"
|
||||
require "custom.language_specific_commands.markdown"
|
||||
|
||||
return M
|
||||
|
||||
@ -58,6 +58,9 @@ local plugins = {
|
||||
init = function()
|
||||
vim.g.rustfmt_autosave = 1
|
||||
end,
|
||||
config = function()
|
||||
require "custom.language_specific_commands.rust"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
@ -173,76 +176,6 @@ local plugins = {
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
lazy = false,
|
||||
requires = { "kyazdani42/nvim-web-devicons" },
|
||||
config = function()
|
||||
local alpha = require "alpha"
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
local function pick_color()
|
||||
local colors = { "String", "Identifier", "Keyword", "Number" }
|
||||
return colors[math.random(#colors)]
|
||||
end
|
||||
|
||||
local function footer()
|
||||
local datetime = os.date " %d-%m-%Y %H:%M:%S"
|
||||
local version = vim.version()
|
||||
local nvim_version_info = " v" .. version.major .. "." .. version.minor .. "." .. version.patch
|
||||
|
||||
return datetime .. nvim_version_info
|
||||
end
|
||||
|
||||
local logo = {
|
||||
[[ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
|
||||
[[ %%%%%=-------------------------------------------=#%%% ]],
|
||||
[[ %%%%%=-----------------------------------------------=#%% ]],
|
||||
[[ %%%%%%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]],
|
||||
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]],
|
||||
[[ %%%%#----------*%% %%%%%---------+%% ]],
|
||||
[[ %%%%#----------+*************************---------+%% ]],
|
||||
[[ %%%%#--------------------------------------------+%%% ]],
|
||||
[[ %%%%#-----------------------------------------#%%%% ]],
|
||||
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
|
||||
[[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%% ]],
|
||||
[[ %%%%#----------*%% ]],
|
||||
[[ %%%%#----------*%% %%%##**++++++*#%%%%%%% %%#***#%% ]],
|
||||
[[%==% %%%%#----------*%%%%=+#=-----------+------------=+-------+==--=*=#=-==%% ]],
|
||||
[[#-=% %%%%#---------=#*===**------------*=-----------++-------=%=----*=--=+=*%*# ]],
|
||||
[[ %*==#%%%%#*##*==-=**#%%%+=--------+*=+**----------*++=----+*#=---=*#%*+==-* % ]],
|
||||
[[ %#+==--==+*#*+===*#*=--------=*+*%%%%%#+=-==----%#=---+#=---=#%%%%%% %*+% ]],
|
||||
[[ %%%%#-----+*==*#%% %#++==#% %%%%%%#=--=% %%#*=+#=-=+%% ]],
|
||||
[[ %%%%#----+*-=%#%%% %+=-*% %% %#=-=# %%#==--=*#%%%% ]],
|
||||
[[ %%%%%=----------------#%% %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%]],
|
||||
[[ %%%%%=----------------#%% %%-----------+%% %%=-------------------=%% %%--------------------=%%]],
|
||||
[[ %%%%%=----------------#%% %%=---*% %%%%%%%%%%*----%%%%%%%%%% %%%%%%%%%%+---=%%%%%%%%%%]],
|
||||
[[ %%%%%=----------------#%% %%=---*% %*----%% %+---=%% ]],
|
||||
[[ %%%%%%%%%%%%%%%%%%%%%%%%% %%-----------+%% %%=----------*%% %%=----------*%% ]],
|
||||
[[ %%%%%%%%%%%%%%%%%%%%%%%%% %%############%% %%###########%%% %%############%% ]],
|
||||
}
|
||||
|
||||
dashboard.section.header.val = logo
|
||||
dashboard.section.header.opts.hl = pick_color()
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("<Leader>ff", " File Explorer"),
|
||||
dashboard.button("<Leader>fo", " Find File"),
|
||||
dashboard.button("<Leader>fw", " Find Word"),
|
||||
dashboard.button("<Leader>fs", " Find Session"),
|
||||
dashboard.button("<Leader>ps", " Update plugins"),
|
||||
dashboard.button("q", " Quit", ":qa<cr>"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
dashboard.section.footer.opts.hl = "Constant"
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
vim.cmd [[ autocmd FileType alpha setlocal nofoldenable ]]
|
||||
end,
|
||||
},
|
||||
}
|
||||
return plugins
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user