Compare commits

..

No commits in common. "04f768affc55e07862705e04caecf6f97cb016fd" and "1aedb8a4741005c1d80a531b698915e43e43db09" have entirely different histories.

9 changed files with 57 additions and 111 deletions

View File

@ -18,12 +18,11 @@ vim.api.nvim_create_autocmd('User', {
callback = function() callback = function()
vim.cmd 'colorscheme neogruber' vim.cmd 'colorscheme neogruber'
require 'feline' require 'feline'
require 'flash'
require 'config.mappings' require 'config.mappings'
require 'config.autocmd' require 'config.autocmd'
require 'nvim-treesitter' require 'nvim-treesitter'
require 'dressing' require 'dressing'
require 'NeoSwap'
require 'nvim-peekup'
end, end,
}) })

View File

@ -40,14 +40,14 @@ vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
end, end,
}) })
-- vim.api.nvim_create_augroup('diagnostics', { clear = true }) vim.api.nvim_create_augroup('diagnostics', { clear = true })
--
-- vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, {
-- group = 'diagnostics', group = 'diagnostics',
-- callback = function() callback = function()
-- vim.diagnostic.setloclist { open = false } vim.diagnostic.setloclist { open = false }
-- end, end,
-- }) })
-- resize splits if window got resized -- resize splits if window got resized
vim.api.nvim_create_autocmd({ 'VimResized' }, { vim.api.nvim_create_autocmd({ 'VimResized' }, {
@ -73,12 +73,3 @@ vim.cmd [[
au ExitPre * :set guicursor=a:hor90 au ExitPre * :set guicursor=a:hor90
augroup END 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()')

View File

@ -1,8 +1,5 @@
local opt = { noremap = true, silent = true } local opt = { noremap = true, silent = true }
local keymap = vim.api.nvim_set_keymap 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 -- TODO: Remove this
keymap('n', '<insert>', '<cmd>Lazy profile<cr>', opt) keymap('n', '<insert>', '<cmd>Lazy profile<cr>', opt)
-- resize {{{ -- resize {{{
@ -14,19 +11,6 @@ keymap('n', '<c-right>', '<cmd>vertical resize -2<cr>', opt)
-- indent {{{ -- indent {{{
keymap('v', '<', '<gv', opt) keymap('v', '<', '<gv', opt)
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 {{{ -- open/close folds with enter key {{{
keymap('n', '<cr>', "@=(foldlevel('.')?'za':\"<Space>\")<CR>", opt) keymap('n', '<cr>', "@=(foldlevel('.')?'za':\"<Space>\")<CR>", opt)
@ -41,23 +25,6 @@ keymap('t', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt)
keymap('v', '<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) 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', '<BS>', ':', { noremap = true })
keymap('n', ';', ':', { noremap = true }) keymap('n', ';', ':', { noremap = true })
@ -284,12 +251,6 @@ local mappings = {
v = { '<C-w>v', 'Vertical split' }, v = { '<C-w>v', 'Vertical split' },
h = { '<C-w>s', 'Horizontal 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) wk.register(mappings, opts)

View File

@ -4,14 +4,6 @@ local opt = vim.opt
g.mapleader = ' ' g.mapleader = ' '
g.tex_flavor = 'latex' g.tex_flavor = 'latex'
g.c_syntax_for_h = true 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.termguicolors = true
opt.mouse = 'nv' opt.mouse = 'nv'
@ -22,7 +14,7 @@ opt.showmode = false
opt.undofile = true opt.undofile = true
opt.updatetime = 300 opt.updatetime = 300
opt.backup = false opt.backup = false
opt.clipboard:prepend { 'unnamedplus', 'unnamed' } opt.clipboard:prepend { 'unnamedplus' }
opt.ignorecase = true opt.ignorecase = true
opt.smartcase = true opt.smartcase = true
opt.sessionoptions = 'folds' opt.sessionoptions = 'folds'
@ -32,7 +24,7 @@ opt.shortmess:append('I', 'W', 's')
opt.iskeyword:prepend { '-' } opt.iskeyword:prepend { '-' }
opt.timeoutlen = 300 opt.timeoutlen = 300
opt.fillchars = 'eob: ' opt.fillchars = 'eob: '
opt.cmdheight = 1 opt.cmdheight = 0
opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden' opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden'
opt.grepformat = '%f:%l:%c:%m' opt.grepformat = '%f:%l:%c:%m'

View File

@ -32,13 +32,12 @@ end
end ]=] end ]=]
M.lsp_config = { M.lsp_config = {
-- virtual_text = { virtual_text = {
-- prefix = '●', prefix = '',
-- }, },
virtual_text = false,
signs = false, signs = false,
underline = true, underline = true,
update_in_insert = false, update_in_insert = true,
severity_sort = false, severity_sort = false,
float = { float = {
focusable = false, focusable = false,

View File

@ -28,8 +28,8 @@ return {
}, },
}, },
completion = { completion = {
-- autocomplete = { 'TextChanged', 'CmdlineChanged', 'TextChangedP' }, autocomplete = { 'TextChanged', 'CmdlineChanged', 'TextChangedP' },
autocomplete = false, -- autocomplete = false,
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
@ -94,8 +94,8 @@ return {
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'neorg' }, { name = 'neorg' },
{ name = 'path' },
{ name = 'snippy' }, { name = 'snippy' },
{ name = 'path' },
{ name = 'buffer' }, { name = 'buffer' },
}, },
} }

View File

@ -1,31 +1,45 @@
return { return {
'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', 'stevearc/dressing.nvim',
opts = {}, opts = {},
-- lazy = false, -- lazy = false,
}, },
'MunifTanjim/nui.nvim',
'folke/which-key.nvim',
'nvim-lua/plenary.nvim',
-- 'mfussenegger/nvim-jdtls',
'simrat39/rust-tools.nvim',
{ 'rush-rs/tree-sitter-asm', ft = 'asm' },
{ 'jghauser/mkdir.nvim', lazy = false },
{ {
url = 'https://git.filnar.com/fiplox/neogruber.git', url = 'https://git.filnar.com/fiplox/neogruber.git',
-- dir = '~/dev/neogruber.nvim/', -- dir = '~/dev/neogruber.nvim/',
lazy = false, lazy = false,
-- event = 'VeryLazy' -- 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', 'numToStr/Comment.nvim',
-- event = 'VeryLazy', -- event = 'VeryLazy',
@ -302,7 +316,7 @@ return {
-- context_commentstring = { enable = true, config = { css = '// %s' } }, -- context_commentstring = { enable = true, config = { css = '// %s' } },
-- indent = {enable = true, disable = {"python", "html", "javascript"}}, -- indent = {enable = true, disable = {"python", "html", "javascript"}},
-- TODO seems to be broken -- TODO seems to be broken
indent = { enable = true, disable = { 'python', 'css' } }, indent = { enable = false, disable = { 'python', 'css' } },
-- autotag = { enable = true }, -- autotag = { enable = true },
} }
end, end,
@ -355,8 +369,4 @@ return {
} }
end, end,
}, },
{
"ecthelionvi/NeoSwap.nvim",
opts = {}
},
} }

View File

@ -7,7 +7,7 @@ local M = {
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'williamboman/mason.nvim' }, dependencies = { 'hrsh7th/cmp-nvim-lsp', 'williamboman/mason.nvim' },
} }
local servers = { 'clangd', 'rust_analyzer', 'lua_ls', 'pyright', 'gopls', 'jdtls', 'asm_lsp', 'texlab', 'elixirls' } local servers = { 'clangd', 'rust_analyzer', 'lua_ls', 'pyright', 'gopls', 'jdtls', 'asm_lsp', 'texlab' }
local function on_attach(client, bufnr) local function on_attach(client, bufnr)
--[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]] --[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]]
@ -113,12 +113,6 @@ function M.config()
} }
goto continue goto continue
end end
if server == 'elixirls' then
local elixir_opts = {
cmd = { "/home/user/.local/share/nvim/mason/packages/elixir-ls/language_server.sh" },
}
opts = vim.tbl_deep_extend('force', elixir_opts, opts)
end
lspconfig[server].setup(opts) lspconfig[server].setup(opts)
::continue:: ::continue::
end end

View File

@ -40,7 +40,7 @@ return {
auto_close = true, -- automatically close the list when you have no diagnostics auto_close = true, -- automatically close the list when you have no diagnostics
auto_preview = false, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window auto_preview = false, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_fold = false, -- automatically fold a file trouble list at creation auto_fold = false, -- automatically fold a file trouble list at creation
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result auto_jump = {}, -- for the given modes, automatically jump if there is only a single result
signs = { signs = {
-- icons / text used for a diagnostic -- icons / text used for a diagnostic
error = "", error = "",