feat!: add new plugins, configs. rm flash
This commit is contained in:
		
							parent
							
								
									1aedb8a474
								
							
						
					
					
						commit
						7e6818319e
					
				
							
								
								
									
										3
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								init.lua
									
									
									
									
									
								
							| @ -18,11 +18,12 @@ vim.api.nvim_create_autocmd('User', { | ||||
| 	callback = function() | ||||
| 		vim.cmd 'colorscheme neogruber' | ||||
| 		require 'feline' | ||||
| 		require 'flash' | ||||
| 		require 'config.mappings' | ||||
| 		require 'config.autocmd' | ||||
| 		require 'nvim-treesitter' | ||||
| 		require 'dressing' | ||||
| 		require 'NeoSwap' | ||||
| 		require 'nvim-peekup' | ||||
| 	end, | ||||
| }) | ||||
| 
 | ||||
|  | ||||
| @ -40,14 +40,14 @@ vim.api.nvim_create_autocmd({ 'TextYankPost' }, { | ||||
| 	end, | ||||
| }) | ||||
| 
 | ||||
| vim.api.nvim_create_augroup('diagnostics', { clear = true }) | ||||
| 
 | ||||
| vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { | ||||
| 	group = 'diagnostics', | ||||
| 	callback = function() | ||||
| 		vim.diagnostic.setloclist { open = false } | ||||
| 	end, | ||||
| }) | ||||
| -- vim.api.nvim_create_augroup('diagnostics', { clear = true }) | ||||
| -- | ||||
| -- vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { | ||||
| -- 	group = 'diagnostics', | ||||
| -- 	callback = function() | ||||
| -- 		vim.diagnostic.setloclist { open = false } | ||||
| -- 	end, | ||||
| -- }) | ||||
| 
 | ||||
| -- resize splits if window got resized | ||||
| vim.api.nvim_create_autocmd({ 'VimResized' }, { | ||||
| @ -73,3 +73,12 @@ vim.cmd [[ | ||||
|         au ExitPre * :set guicursor=a:hor90 | ||||
|     augroup END | ||||
| ]] | ||||
| 
 | ||||
| function _G.set_terminal_keymaps() | ||||
| 	local opts = { buffer = 0 } | ||||
| 	vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts) | ||||
| 	vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts) | ||||
| end | ||||
| 
 | ||||
| -- if you only want these mappings for toggle term use term://*toggleterm#* instead | ||||
| vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') | ||||
|  | ||||
| @ -1,5 +1,8 @@ | ||||
| local opt = { noremap = true, silent = true } | ||||
| local keymap = vim.api.nvim_set_keymap | ||||
| 
 | ||||
| keymap('n', '<c-,>', '<cmd>silent! NeoSwapPrev<cr>', opt) | ||||
| keymap('n', '<c-.>', '<cmd>silent! NeoSwapNext<cr>', opt) | ||||
| -- TODO: Remove this | ||||
| keymap('n', '<insert>', '<cmd>Lazy profile<cr>', opt) | ||||
| -- resize {{{ | ||||
| @ -11,6 +14,19 @@ keymap('n', '<c-right>', '<cmd>vertical resize -2<cr>', opt) | ||||
| -- indent {{{ | ||||
| keymap('v', '<', '<gv', opt) | ||||
| keymap('v', '>', '>gv', opt) | ||||
| vim.cmd([[ | ||||
| nnoremap <c-j> :m .+1<CR>== | ||||
| nnoremap <c-k> :m .-2<CR>== | ||||
| inoremap <c-j> <Esc>:m .+1<CR>==gi | ||||
| inoremap <c-k> <Esc>:m .-2<CR>==gi | ||||
| vnoremap <c-j> :m '>+1<CR>gv=gv | ||||
| vnoremap <c-k> :m '<-2<CR>gv=gv | ||||
| ]]) | ||||
| 
 | ||||
| keymap('n', 'Y', '"+y', opt) | ||||
| keymap('v', 'Y', '"+y', opt) | ||||
| keymap('n', '<c-p>', '"+p', opt) | ||||
| keymap('v', '<c-p>', '"+p', opt) | ||||
| -- }}} | ||||
| -- open/close folds with enter key {{{ | ||||
| keymap('n', '<cr>', "@=(foldlevel('.')?'za':\"<Space>\")<CR>", opt) | ||||
| @ -25,6 +41,23 @@ keymap('t', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | ||||
| keymap('v', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | ||||
| keymap('i', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | ||||
| -- }}} | ||||
| -- trouble {{{ | ||||
| vim.api.nvim_set_keymap('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>', { silent = true, noremap = true }) | ||||
| vim.api.nvim_set_keymap('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', { silent = true, noremap = true }) | ||||
| vim.api.nvim_set_keymap('n', '<leader>xx', '<cmd>TroubleToggle<cr>', { silent = true, noremap = true }) | ||||
| vim.api.nvim_set_keymap( | ||||
| 	'n', | ||||
| 	'<leader>xw', | ||||
| 	'<cmd>TroubleToggle workspace_diagnostics<cr>', | ||||
| 	{ silent = true, noremap = true } | ||||
| ) | ||||
| vim.api.nvim_set_keymap( | ||||
| 	'n', | ||||
| 	'<leader>xd', | ||||
| 	'<cmd>TroubleToggle document_diagnostics<cr>', | ||||
| 	{ silent = true, noremap = true } | ||||
| ) | ||||
| -- }}} | ||||
| 
 | ||||
| keymap('n', '<BS>', ':', { noremap = true }) | ||||
| keymap('n', ';', ':', { noremap = true }) | ||||
| @ -251,6 +284,12 @@ local mappings = { | ||||
| 		v = { '<C-w>v', 'Vertical split' }, | ||||
| 		h = { '<C-w>s', 'Horizontal split' }, | ||||
| 	}, | ||||
| 	['o'] = { | ||||
| 		name = 'Neorg', | ||||
| 		i = { '<cmd>Neorg index<cr>', 'Index' }, | ||||
| 		n = { '<cmd>Neorg workspace notes<cr>', 'Notes' }, | ||||
| 		t = { '<cmd>Neorg workspace todo<cr>', 'Todo' }, | ||||
| 	} | ||||
| } | ||||
| -- }}} | ||||
| wk.register(mappings, opts) | ||||
|  | ||||
| @ -4,6 +4,14 @@ local opt = vim.opt | ||||
| g.mapleader = ' ' | ||||
| g.tex_flavor = 'latex' | ||||
| g.c_syntax_for_h = true | ||||
| vim.cmd([[ | ||||
| let g:VM_leader                     = {'default': ',', 'visual': ',', 'buffer': ','} | ||||
| let g:VM_maps                       = {} | ||||
| let g:VM_custom_motions             = {'n': 'j', 'l': 'i', 'e': 'k', 'i': 'l'} | ||||
| let g:VM_maps['i']                  = 'l' | ||||
| let g:VM_maps['I']                  = 'L' | ||||
| let g:VM_mouse_mappings             = 1 | ||||
| ]]) | ||||
| 
 | ||||
| opt.termguicolors = true | ||||
| opt.mouse = 'nv' | ||||
| @ -14,7 +22,7 @@ opt.showmode = false | ||||
| opt.undofile = true | ||||
| opt.updatetime = 300 | ||||
| opt.backup = false | ||||
| opt.clipboard:prepend { 'unnamedplus' } | ||||
| opt.clipboard:prepend { 'unnamedplus', 'unnamed' } | ||||
| opt.ignorecase = true | ||||
| opt.smartcase = true | ||||
| opt.sessionoptions = 'folds' | ||||
| @ -24,7 +32,7 @@ opt.shortmess:append('I', 'W', 's') | ||||
| opt.iskeyword:prepend { '-' } | ||||
| opt.timeoutlen = 300 | ||||
| opt.fillchars = 'eob: ' | ||||
| opt.cmdheight = 0 | ||||
| opt.cmdheight = 1 | ||||
| opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden' | ||||
| opt.grepformat = '%f:%l:%c:%m' | ||||
| 
 | ||||
|  | ||||
| @ -1,45 +1,31 @@ | ||||
| return { | ||||
| 	{ | ||||
| 		'stevearc/dressing.nvim', | ||||
| 		opts = {}, | ||||
| 		-- lazy = false, | ||||
| 	}, | ||||
| 	'MunifTanjim/nui.nvim', | ||||
| 	'folke/which-key.nvim', | ||||
| 	'nvim-lua/plenary.nvim', | ||||
| 	--	'mfussenegger/nvim-jdtls', | ||||
| 	'simrat39/rust-tools.nvim', | ||||
| 	{ 'mg979/vim-visual-multi',  event = 'VeryLazy' }, | ||||
| 	{ 'rush-rs/tree-sitter-asm', ft = 'asm' }, | ||||
| 	{ | ||||
| 		'gennaro-tedesco/nvim-peekup', | ||||
| 		config = function() | ||||
| 			local c = require 'nvim-peekup.config' | ||||
| 			c.on_keystroke['delay'] = '' | ||||
| 			c.on_keystroke['paste_reg'] = '+' | ||||
| 		end | ||||
| 	}, | ||||
| 	{ 'jghauser/mkdir.nvim', lazy = false }, | ||||
| 	{ | ||||
| 		'stevearc/dressing.nvim', | ||||
| 		opts = {}, | ||||
| 		-- lazy = false, | ||||
| 	}, | ||||
| 	{ | ||||
| 		url = 'https://git.filnar.com/fiplox/neogruber.git', | ||||
| 		-- dir = '~/dev/neogruber.nvim/', | ||||
| 		lazy = false, | ||||
| 		-- event = 'VeryLazy' | ||||
| 	}, | ||||
| 	{ | ||||
| 		'folke/flash.nvim', | ||||
| 		-- event = 'VeryLazy', | ||||
| 		---@type Flash.Config | ||||
| 		opts = {}, | ||||
| 		keys = { | ||||
| 			{ | ||||
| 				's', | ||||
| 				mode = { 'n', 'x', 'o' }, | ||||
| 				function() | ||||
| 					-- default options: exact mode, multi window, all directions, with a backdrop | ||||
| 					require('flash').jump() | ||||
| 				end, | ||||
| 			}, | ||||
| 			{ | ||||
| 				'S', | ||||
| 				mode = { 'o', 'x' }, | ||||
| 				function() | ||||
| 					require('flash').treesitter() | ||||
| 				end, | ||||
| 			}, | ||||
| 		}, | ||||
| 	}, | ||||
| 	{ | ||||
| 		'numToStr/Comment.nvim', | ||||
| 		-- event = 'VeryLazy', | ||||
| @ -316,7 +302,7 @@ return { | ||||
| 				-- context_commentstring = { enable = true, config = { css = '// %s' } }, | ||||
| 				-- indent = {enable = true, disable = {"python", "html", "javascript"}}, | ||||
| 				-- TODO seems to be broken | ||||
| 				indent = { enable = false, disable = { 'python', 'css' } }, | ||||
| 				indent = { enable = true, disable = { 'python', 'css' } }, | ||||
| 				-- autotag = { enable = true }, | ||||
| 			} | ||||
| 		end, | ||||
| @ -369,4 +355,8 @@ return { | ||||
| 			} | ||||
| 		end, | ||||
| 	}, | ||||
| 	{ | ||||
| 		"ecthelionvi/NeoSwap.nvim", | ||||
| 		opts = {} | ||||
| 	}, | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user