some changes to keymaps, cursor, etc.
This commit is contained in:
parent
b42073a951
commit
c59fb8a2f1
28
init.lua
28
init.lua
|
@ -8,6 +8,17 @@ package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share
|
||||||
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua'
|
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua'
|
||||||
|
|
||||||
vim.opt_local.autochdir = true
|
vim.opt_local.autochdir = true
|
||||||
|
|
||||||
|
vim.opt.spelllang = 'en_us'
|
||||||
|
vim.opt.spell = true
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<C-s>', ':!feh --geometry 640x480+1200+50 <cfile><CR>', { desc = 'Show image under cursor with feh' })
|
||||||
|
|
||||||
|
require 'keymaps'
|
||||||
|
|
||||||
|
vim.opt.foldmethod = syntax
|
||||||
|
vim.opt.foldlevel = 99
|
||||||
|
|
||||||
-- END OF TESTING REGION
|
-- END OF TESTING REGION
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
@ -165,6 +176,7 @@ vim.opt.inccommand = 'split'
|
||||||
|
|
||||||
-- Show which line your cursor is on
|
-- Show which line your cursor is on
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.cursorlineopt = 'number'
|
||||||
|
|
||||||
-- 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
|
||||||
|
@ -291,12 +303,12 @@ require('lazy').setup({
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
config = function() -- This is the function that runs, AFTER loading
|
||||||
require('which-key').setup()
|
require('which-key').setup()
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
|
-- need to try out specific trigger keys, <leader> AND <c>: https://github.com/folke/which-key.nvim
|
||||||
require('which-key').add {
|
require('which-key').add {
|
||||||
{ '<leader>c', group = '[C]ode' },
|
{ '<leader>c', group = '[C]ode' },
|
||||||
{ '<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' },
|
||||||
|
@ -383,7 +395,9 @@ require('lazy').setup({
|
||||||
local builtin = require 'telescope.builtin'
|
local builtin = require 'telescope.builtin'
|
||||||
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
||||||
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
||||||
|
vim.keymap.set('n', '<leader>sb', ':Telescope neoclip<CR>', { desc = '[S]earch [B]uffers' })
|
||||||
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
||||||
|
vim.keymap.set('n', '<leader>si', builtin.git_files, { desc = '[S]earch [F]iles [i]n git repo' })
|
||||||
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
||||||
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
||||||
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
||||||
|
@ -391,8 +405,9 @@ require('lazy').setup({
|
||||||
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
||||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>sl', ':Telescope luasnip<CR>', { desc = '[S]earch [L]uasnip' })
|
vim.keymap.set('n', '<leader>sl', ':Telescope luasnip<CR>', { desc = '[S]earch [L]uasnip' })
|
||||||
|
vim.keymap.set('n', '<leader>se', ':Telescope emoji<CR>', { desc = '[S]earch [E]mojis' })
|
||||||
|
vim.keymap.set('i', '<C-e>', '<esc>:Telescope emoji<CR>', { desc = '[S]earch [E]mojis' })
|
||||||
|
|
||||||
-- Slightly advanced example of overriding default behavior and theme
|
-- Slightly advanced example of overriding default behavior and theme
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
|
@ -628,6 +643,8 @@ require('lazy').setup({
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'stylua', -- Used to format Lua code
|
'stylua', -- Used to format Lua code
|
||||||
|
'black', -- Used to format Python code
|
||||||
|
'isort', -- Used to format Python code
|
||||||
})
|
})
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
|
@ -675,7 +692,7 @@ require('lazy').setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
python = { 'isort', 'black' },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
@ -879,6 +896,7 @@ require('lazy').setup({
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
|
|
||||||
|
require('nvim-treesitter.install').prefer_git = true
|
||||||
---@diagnostic disable-next-line: missing-fields
|
---@diagnostic disable-next-line: missing-fields
|
||||||
require('nvim-treesitter.configs').setup(opts)
|
require('nvim-treesitter.configs').setup(opts)
|
||||||
|
|
||||||
|
@ -904,7 +922,7 @@ require('lazy').setup({
|
||||||
require 'kickstart.plugins.indent_line',
|
require 'kickstart.plugins.indent_line',
|
||||||
require 'kickstart.plugins.lint',
|
require 'kickstart.plugins.lint',
|
||||||
require 'kickstart.plugins.autopairs',
|
require 'kickstart.plugins.autopairs',
|
||||||
require 'kickstart.plugins.neo-tree',
|
-- require 'kickstart.plugins.neo-tree',
|
||||||
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user