batman
This commit is contained in:
commit
ca57342a54
14 changed files with 965 additions and 0 deletions
89
lua/core/keymaps.lua
Normal file
89
lua/core/keymaps.lua
Normal file
|
@ -0,0 +1,89 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
-- ─< lua/keymaps.lua >─────────────────────────────────────────────────────────────────
|
||||
local nomap = vim.keymap.set
|
||||
nomap("i", "<C-k>", "")
|
||||
nomap("n", "<C-k>", "")
|
||||
nomap("n", "q", "")
|
||||
nomap("v", "q", "")
|
||||
nomap("v", "<leader>S", "")
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||
|
||||
-- ─< Comment >─────────────────────────────────────────────────────────────────────────
|
||||
map("n", "<S-c>", "gcc", { desc = "comment toggle", remap = true })
|
||||
map("v", "<S-c>", "gc", { desc = "comment toggle", remap = true })
|
||||
|
||||
-- ─< Terminal >────────────────────────────────────────────────────────────────────────
|
||||
map("t", "<C-x>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
|
||||
|
||||
-- ─< Movement while in "insert"-mode >─────────────────────────────────────────────────
|
||||
map("i", "<C-b>", "<ESC>^i", { desc = "move beginning of line" })
|
||||
map("i", "<C-e>", "<End>", { desc = "move end of line" })
|
||||
map("i", "<C-h>", "<Left>", { desc = "move left" })
|
||||
map("i", "<C-l>", "<Right>", { desc = "move right" })
|
||||
map("i", "<C-j>", "<Down>", { desc = "move down" })
|
||||
map("i", "<C-k>", "<Up>", { desc = "move up" })
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
map("i", "<C-c>", "<ESC>")
|
||||
map("n", "<C-c>", "<ESC>")
|
||||
map("v", "<C-c>", "<ESC>")
|
||||
|
||||
map("n", "<leader>x", "<cmd>bd!<CR>")
|
||||
|
||||
-- ─< Disable arrow keys in normal mode >───────────────────────────────────────────────
|
||||
map("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||
map("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||
map("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||
map("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
map("n", "<leader>l", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
||||
map("n", "<leader>h", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
||||
map("n", "<leader>j", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
||||
map("n", "<leader>k", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||
|
||||
-- map("n", "<leader>p", vim.cmd.Ex)
|
||||
map("n", "<leader>q", vim.cmd.q)
|
||||
map("n", "<leader>s", vim.cmd.w)
|
||||
map("n", "<C-s>", vim.cmd.w)
|
||||
|
||||
-- ─< rename word under cursor >───────────────────────────────────────────────────────────
|
||||
map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
-- window management
|
||||
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
||||
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
||||
|
||||
vim.keymap.set({ "n", "i" }, "<leader>tt", function()
|
||||
-- Frage den Shell-Command ab
|
||||
vim.ui.input({ prompt = "Shell Command: " }, function(cmd)
|
||||
if cmd == nil or cmd == "" then
|
||||
return
|
||||
end
|
||||
|
||||
local result = vim.fn.system(cmd)
|
||||
local exit_code = vim.v.shell_error
|
||||
|
||||
if exit_code ~= 0 then
|
||||
vim.notify("Shell Error:\n" .. result, vim.log.levels.ERROR, { title = "Shell Command Failed" })
|
||||
return
|
||||
end
|
||||
|
||||
local lines = vim.split(result, "\n", { trimempty = true })
|
||||
|
||||
-- Insert at cursor position
|
||||
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
if #lines == 1 then
|
||||
-- Insert inline if the result is a single line
|
||||
local current_line = vim.api.nvim_get_current_line()
|
||||
local new_line = current_line:sub(1, col) .. lines[1] .. current_line:sub(col + 1)
|
||||
vim.api.nvim_set_current_line(new_line)
|
||||
else
|
||||
vim.api.nvim_buf_set_lines(0, row, row, false, lines)
|
||||
end
|
||||
end)
|
||||
end, { desc = "Insert Shell Output at Cursor" })
|
85
lua/core/options.lua
Normal file
85
lua/core/options.lua
Normal file
|
@ -0,0 +1,85 @@
|
|||
vim.cmd("let g:netrw_liststyle = 3")
|
||||
|
||||
local o = vim.opt
|
||||
|
||||
o.relativenumber = true
|
||||
o.number = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
o.scrolloff = 8
|
||||
|
||||
-- tabs & indentation
|
||||
o.tabstop = 2 -- 2 spaces for tabs (prettier default)
|
||||
o.shiftwidth = 2 -- 2 spaces for indent width
|
||||
o.softtabstop = 2
|
||||
-- o.tabstop = 4 -- for TitusWorkings
|
||||
-- o.shiftwidth = 4 -- for TitusWorkings
|
||||
-- o.softtabstop = 4 -- for TitusWorkings
|
||||
o.expandtab = true -- expand tab to spaces
|
||||
o.autoindent = true -- copy indent from current line when starting new one
|
||||
|
||||
o.mouse = "a"
|
||||
o.mousemoveevent = true
|
||||
o.wrap = false
|
||||
|
||||
-- search settings
|
||||
o.ignorecase = true -- ignore case when searching
|
||||
o.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive
|
||||
|
||||
o.cursorline = true
|
||||
|
||||
-- Don't show the mode, since it's already in the status line
|
||||
o.showmode = false
|
||||
|
||||
-- turn on termguicolors for tokyonight colorscheme to work
|
||||
-- (have to use iterm2 or any other true color terminal)
|
||||
o.termguicolors = true
|
||||
o.background = "dark" -- colorschemes that can be light or dark will be made dark
|
||||
o.signcolumn = "yes" -- show sign column so that text doesn't shift
|
||||
|
||||
-- backspace
|
||||
o.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position
|
||||
|
||||
-- clipboard
|
||||
o.clipboard:append("unnamedplus") -- use system clipboard as default register
|
||||
|
||||
-- split windows
|
||||
o.splitright = true -- split vertical window to the right
|
||||
o.splitbelow = true -- split horizontal window to the bottom
|
||||
o.splitkeep = "screen"
|
||||
o.laststatus = 3
|
||||
|
||||
-- turn off swapfile
|
||||
o.swapfile = false
|
||||
|
||||
-- Disable the tilde on empty lines
|
||||
o.fillchars = { eob = " " }
|
||||
|
||||
-- SudaRead automatic if file is inaccessible
|
||||
vim.g.suda_smart_edit = 1
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set cursor to beam when entering Neovim
|
||||
vim.cmd([[
|
||||
augroup ChangeCursorShape
|
||||
autocmd!
|
||||
autocmd VimEnter * set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20
|
||||
autocmd VimLeave * set guicursor=a:ver25
|
||||
augroup END
|
||||
]])
|
||||
|
||||
if vim.g.neovide then
|
||||
-- vim.g.neovide_transparency = 0.35
|
||||
vim.g.neovide_transparency = 1
|
||||
vim.g.neovide_theme = "dark"
|
||||
vim.g.neovide_refresh_rate = 90
|
||||
vim.g.neovide_cursor_vfx_mode = "torpedo"
|
||||
vim.g.neovide_cursor_smooth_blink = true
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue