Updates to most things, new keybinds, local terminal.
This commit is contained in:
parent
d7645de63d
commit
87b443444c
@ -1,12 +1,47 @@
|
||||
-- Print variables function
|
||||
P = function(v)
|
||||
print(vim.inspect(v))
|
||||
return v
|
||||
end
|
||||
|
||||
-- Custom keymaps
|
||||
vim.g.mapleader = " "
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>gg", vim.cmd.LazyGit)
|
||||
vim.keymap.set("n", "<leader>nt", function()
|
||||
vim.cmd("tabnew")
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>mv", function()
|
||||
vim.cmd("Markview splitToggle")
|
||||
end)
|
||||
vim.keymap.set('n', '<leader><leader>r', function()
|
||||
vim.cmd("w")
|
||||
vim.cmd("source %")
|
||||
end)
|
||||
vim.keymap.set("n", "-", "<cmd>Oil<CR>")
|
||||
vim.keymap.set("n", "<leader>w", "<cmd>w<CR>")
|
||||
vim.keymap.set("n", "<leader>nh", "<cmd>noh<CR>")
|
||||
vim.keymap.set("n", "<leader>wq", "<cmd>wq!<CR>")
|
||||
vim.keymap.set("n", "<leader>fh", "<cmd>Telescope help_tags<CR>")
|
||||
|
||||
-- Terminal in neovim --
|
||||
vim.api.nvim_create_autocmd('TermOpen', {
|
||||
group = vim.api.nvim_create_augroup('open-terminal', { clear = true }),
|
||||
callback = function()
|
||||
vim.opt.number = false
|
||||
vim.opt.relativenumber = false
|
||||
end,
|
||||
})
|
||||
local job_id = 0
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
vim.cmd.vnew()
|
||||
vim.cmd.term()
|
||||
vim.cmd.wincmd("J")
|
||||
vim.api.nvim_win_set_height(0, 15)
|
||||
job_id = vim.bo.channel
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>build", function()
|
||||
vim.fn.chansend(job_id, { "ls -lah<CR>" })
|
||||
end)
|
||||
|
||||
-- General config
|
||||
vim.cmd("set expandtab")
|
||||
vim.cmd("set tabstop=2")
|
||||
vim.cmd("set softtabstop=2")
|
||||
@ -18,8 +53,11 @@ vim.cmd("set relativenumber")
|
||||
vim.cmd("set rnu")
|
||||
vim.cmd("set number relativenumber")
|
||||
vim.cmd("set nu rnu")
|
||||
-- vim.cmd("set guicursor=n-v-c-i:block")
|
||||
-- vim.cmd("set guicursor=a:blinkon100")
|
||||
vim.api.nvim_set_option("clipboard","unnamed")
|
||||
|
||||
-- Command to turn off diagnostics, if crowding screen
|
||||
vim.api.nvim_create_user_command("DiagnosticsToggle", function()
|
||||
local config = vim.diagnostic.config
|
||||
local vt = config().virtual_text
|
||||
@ -29,3 +67,4 @@ vim.api.nvim_create_user_command("DiagnosticsToggle", function()
|
||||
signs = not vt,
|
||||
}
|
||||
end, { desc = "toggle diagnostic" })
|
||||
vim.keymap.set("n", "<leader>dt", "<cmd>DiagnosticsToggle<CR>")
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
return {
|
||||
-- Call local plugins here.
|
||||
}
|
||||
|
||||
9
lua/plugins/ahoy.lua
Normal file
9
lua/plugins/ahoy.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
-- dir = "/Users/danchadwick/Projects/neovim/ahoy.nvim",
|
||||
"calcu1on/ahoy.nvim",
|
||||
config = function()
|
||||
local ahoy = require('ahoy')
|
||||
vim.keymap.set('n', '<leader>sf', function() ahoy.save_file() end)
|
||||
end
|
||||
}
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter", -- load plugin after all configuration is set
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
dashboard.section.header.val = {
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ████ ██████ █████ ██ ]],
|
||||
[[ ███████████ █████ ]],
|
||||
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
}
|
||||
|
||||
_Gopts = {
|
||||
position = "center",
|
||||
hl = "Type",
|
||||
-- wrap = "overflow";
|
||||
}
|
||||
|
||||
-- Set menu
|
||||
dashboard.section.buttons.val = {
|
||||
-- dashboard.button("SPC j", " Restore Session", ":SessionRestore<cr>"),
|
||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("f", " Find file", ":cd $HOME/dotfiles/.config | Telescope find_files<CR>"),
|
||||
dashboard.button("g", " Find word", ":Telescope live_grep<CR>"),
|
||||
dashboard.button("r", " Recent", ":Telescope oldfiles<CR>"),
|
||||
dashboard.button("c", " Config", ":e $MYVIMRC <CR>"),
|
||||
dashboard.button("m", " Mason", ":Mason<CR>"),
|
||||
dashboard.button("l", " Lazy", ":Lazy<CR>"),
|
||||
dashboard.button("u", " Update plugins", "<cmd>lua require('lazy').sync()<CR>"),
|
||||
dashboard.button("q", " Quit NVIM", ":qa<CR>"),
|
||||
}
|
||||
|
||||
--local function footer()
|
||||
--return "Mohammed Babiker Babai"
|
||||
--end
|
||||
|
||||
--dashboard.section.footer.val = footer()
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
require("alpha").setup(dashboard.opts)
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimStarted",
|
||||
callback = function()
|
||||
local stats = require("lazy").stats()
|
||||
local count = (math.floor(stats.startuptime * 100) / 100)
|
||||
dashboard.section.footer.val = {
|
||||
" " .. stats.count .. " plugins loaded in " .. count .. " ms"
|
||||
}
|
||||
pcall(vim.cmd.AlphaRedraw)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
return {
|
||||
"renerocksai/calendar-vim"
|
||||
}
|
||||
@ -26,11 +26,11 @@ return {
|
||||
sorter = conf.generic_sorter({}),
|
||||
}):find()
|
||||
end
|
||||
vim.keymap.set("n", "<C-h>", function() toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window" })
|
||||
-- vim.keymap.set("n", "<C-h>", function() toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window" })
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<leader>c", function() harpoon:list():clear() end)
|
||||
vim.keymap.set("n", "<leader>r", function() harpoon:list():remove() end)
|
||||
-- vim.keymap.set("n", "<C-h>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
vim.keymap.set("n", "<leader>h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
-- vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
|
||||
-- vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
|
||||
|
||||
@ -8,6 +8,6 @@ return {
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set("n", "<C-n>", ':Neotree filesystem reveal left<CR>', {})
|
||||
vim.keymap.set("n", "<C-e>", ':Neotree position=current<CR>', {})
|
||||
vim.keymap.set("n", "<C-e>", ':Neotree filesystem reveal current<CR>', {})
|
||||
end
|
||||
}
|
||||
|
||||
13
lua/plugins/oil.lua
Normal file
13
lua/plugins/oil.lua
Normal file
@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
}
|
||||
}
|
||||
@ -1,2 +0,0 @@
|
||||
return {
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user