donny-top commits
This commit is contained in:
parent
94f551b803
commit
b421d0ccaf
43
init.lua
43
init.lua
|
@ -1,5 +1,6 @@
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
|
|
||||||
=====================================================================
|
=====================================================================
|
||||||
==================== READ THIS BEFORE CONTINUING ====================
|
==================== READ THIS BEFORE CONTINUING ====================
|
||||||
=====================================================================
|
=====================================================================
|
||||||
|
@ -102,7 +103,7 @@ vim.g.have_nerd_font = false
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
-- You can also add relative line numbers, to help with jumping.
|
-- You can also add relative line numbers, to help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||||
vim.opt.mouse = 'a'
|
vim.opt.mouse = 'a'
|
||||||
|
@ -156,38 +157,8 @@ vim.opt.cursorline = true
|
||||||
-- Minimal number of screen lines to keep above and below the cursor.
|
-- Minimal number of screen lines to keep above and below the cursor.
|
||||||
vim.opt.scrolloff = 10
|
vim.opt.scrolloff = 10
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
--pull in remaps
|
||||||
-- See `:help vim.keymap.set()`
|
require 'remap'
|
||||||
|
|
||||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
|
||||||
-- See `:help hlsearch`
|
|
||||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
|
||||||
|
|
||||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
|
||||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
|
||||||
-- is not what someone will guess without a bit more experience.
|
|
||||||
--
|
|
||||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
|
||||||
-- or just use <C-\><C-n> to exit terminal mode
|
|
||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
|
||||||
|
|
||||||
-- TIP: Disable arrow keys in normal mode
|
|
||||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
|
||||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
|
||||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
|
||||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
|
||||||
|
|
||||||
-- Keybinds to make split navigation easier.
|
|
||||||
-- Use CTRL+<hjkl> to switch between windows
|
|
||||||
--
|
|
||||||
-- See `:help wincmd` for a list of all window commands
|
|
||||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
|
||||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
|
||||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See `:help lua-guide-autocommands`
|
-- See `:help lua-guide-autocommands`
|
||||||
|
@ -328,7 +299,7 @@ require('lazy').setup({
|
||||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
||||||
{ '<leader>d', group = '[D]ocument' },
|
{ '<leader>d', group = '[D]ocument' },
|
||||||
{ '<leader>r', group = '[R]ename' },
|
{ '<leader>r', group = '[R]ename' },
|
||||||
{ '<leader>s', group = '[S]earch' },
|
{ '<leader>S', group = '[S]earch' },
|
||||||
{ '<leader>w', group = '[W]orkspace' },
|
{ '<leader>w', group = '[W]orkspace' },
|
||||||
{ '<leader>t', group = '[T]oggle' },
|
{ '<leader>t', group = '[T]oggle' },
|
||||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||||
|
@ -628,6 +599,7 @@ require('lazy').setup({
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
|
pylsp = {},
|
||||||
-- pyright = {},
|
-- pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
|
@ -859,8 +831,7 @@ require('lazy').setup({
|
||||||
-- Load the colorscheme here.
|
-- Load the colorscheme here.
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
-- Like many other themes, this one has different styles, and you could load
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
vim.cmd.colorscheme 'tokyonight-storm'
|
||||||
|
|
||||||
-- You can configure highlights by doing something like:
|
-- You can configure highlights by doing something like:
|
||||||
vim.cmd.hi 'Comment gui=none'
|
vim.cmd.hi 'Comment gui=none'
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
-- [[ Basic Keymaps ]]
|
||||||
|
-- See `:help vim.keymap.set()`
|
||||||
|
|
||||||
|
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||||
|
-- See `:help hlsearch`
|
||||||
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
|
|
||||||
|
-- Diagnostic keymaps
|
||||||
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
|
--navigation keymaps
|
||||||
|
vim.keymap.set('n', '<leader>pv', vim.cmd.Ex, { desc = 'Exit file and return to navigation' })
|
||||||
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||||
|
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
||||||
|
-- is not what someone will guess without a bit more experience.
|
||||||
|
--
|
||||||
|
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
||||||
|
-- or just use <C-\><C-n> to exit terminal mode
|
||||||
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
|
-- TIP: Disable arrow keys in normal mode
|
||||||
|
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||||
|
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||||
|
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||||
|
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||||
|
|
||||||
|
-- Keybinds to make split navigation easier.
|
||||||
|
-- Use CTRL+<hjkl> to switch between windows
|
||||||
|
--
|
||||||
|
-- See `:help wincmd` for a list of all window commands
|
||||||
|
vim.keymap.set('n', '<leader>u', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||||
|
vim.keymap.set('n', '<leader>i', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||||
|
vim.keymap.set('n', '<leader>l', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||||
|
vim.keymap.set('n', '<leader>o', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||||
|
--split window maps
|
||||||
|
vim.keymap.set('n', '<leader>xs', ':close', { desc = 'Close current window' })
|
||||||
|
vim.keymap.set('n', '<leader>s', ':vsplit', { desc = 'Split window vertically' })
|
Loading…
Reference in New Issue