Compare commits
4 Commits
ade875c1f1
...
c2b60ad356
Author | SHA1 | Date | |
---|---|---|---|
c2b60ad356 | |||
7b8ea9c3af | |||
f44336163f | |||
4919a82354 |
@ -133,10 +133,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
|
||||
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>')
|
||||
-- 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
|
||||
@ -273,6 +273,7 @@ require('lazy').setup({
|
||||
end,
|
||||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
{ 'nvim-telescope/telescope-live-grep-args.nvim' },
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||
@ -328,6 +329,9 @@ require('lazy').setup({
|
||||
-- Enable Telescope extensions if they are installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
pcall(require('telescope').load_extension, 'ui-select')
|
||||
pcall(require('telescope').load_extension 'live_grep_args')
|
||||
|
||||
local live_grep_args = require('telescope').extensions.live_grep_args
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
local builtin = require 'telescope.builtin'
|
||||
@ -377,6 +381,14 @@ require('lazy').setup({
|
||||
vim.keymap.set('n', '<leader>sn', function()
|
||||
builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
||||
end, { desc = '[S]earch [N]eovim files' })
|
||||
|
||||
-- Search for TODO items in the current file
|
||||
vim.keymap.set('n', '<leader>sT', function()
|
||||
live_grep_args.live_grep_args {
|
||||
default_text = '(TODO|XXX):.*',
|
||||
search_dirs = { vim.fn.expand '%' },
|
||||
}
|
||||
end, { desc = '[S]earch [T]odo current file' })
|
||||
end,
|
||||
},
|
||||
|
||||
@ -816,6 +828,16 @@ require('lazy').setup({
|
||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require('mini.surround').setup()
|
||||
|
||||
-- Expand and collapse object definitions.
|
||||
require('mini.splitjoin').setup {
|
||||
mappings = {
|
||||
-- Remove default mapping
|
||||
toggle = '',
|
||||
},
|
||||
|
||||
vim.keymap.set('n', 'gs', '<cmd>lua MiniSplitjoin.toggle()<CR>', { desc = '[S]plitjoin toggle' }),
|
||||
}
|
||||
|
||||
-- Startup dashboard
|
||||
require('mini.starter').setup {
|
||||
footer = '',
|
||||
|
@ -2,19 +2,22 @@
|
||||
-- https://github.com/nvim-focus/focus.nvim
|
||||
return {
|
||||
'nvim-focus/focus.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
enable = true,
|
||||
ui = {
|
||||
-- Display line numbers in the focused window only.
|
||||
hybridnumber = true,
|
||||
|
||||
-- Display signcolumn in the focussed window only
|
||||
-- Display signcolumn in the focused window only.
|
||||
signcolumn = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local ignore_buftypes = { 'dbui' }
|
||||
require('focus').setup {}
|
||||
|
||||
local ignore_buftypes = { 'dbui' }
|
||||
local ignore_filetypes = { 'dbui' }
|
||||
local augroup = vim.api.nvim_create_augroup('FocusDisable', { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd('WinEnter', {
|
||||
@ -28,5 +31,17 @@ return {
|
||||
end,
|
||||
desc = 'Disable focus autoresize for BufType',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
group = augroup,
|
||||
callback = function(_)
|
||||
if vim.tbl_contains(ignore_filetypes, vim.bo.filetype) then
|
||||
vim.b.focus_disable = true
|
||||
else
|
||||
vim.b.focus_disable = false
|
||||
end
|
||||
end,
|
||||
desc = 'Disable focus autoresize for FileType',
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user