mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-04-26 12:25:39 +00:00
Egrepify and some keybindings
This commit is contained in:
parent
814000d6e8
commit
5782602a20
@ -118,3 +118,12 @@ vim.api.nvim_create_autocmd('User', {
|
|||||||
deps_job:start()
|
deps_job:start()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('User', {
|
||||||
|
pattern = 'NeogitBranchCheckout',
|
||||||
|
group = group,
|
||||||
|
callback = function ()
|
||||||
|
deps_job:and_then(compile_job)
|
||||||
|
deps_job:start()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
@ -40,6 +40,12 @@ nnoremap('<leader>tk', '<C-w>t<C-w>K')
|
|||||||
|
|
||||||
-- Keybindings below this are neovim cli only
|
-- Keybindings below this are neovim cli only
|
||||||
if vim.g.vscode then
|
if vim.g.vscode then
|
||||||
|
-- Toggle Comment
|
||||||
|
vim.keymap.set('x', 'gc', '<Plug>VSCodeCommentary', {})
|
||||||
|
vim.keymap.set('n', 'gc', '<Plug>VSCodeCommentary', {})
|
||||||
|
vim.keymap.set('o', 'gc', '<Plug>VSCodeCommentary', {})
|
||||||
|
vim.keymap.set('n', 'gcc', '<Plug>VSCodeCommentaryLine', {})
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -65,6 +71,16 @@ nnoremap('<S-TAB>', ':bprevious<CR>')
|
|||||||
nnoremap('[q', ':cprev<CR>')
|
nnoremap('[q', ':cprev<CR>')
|
||||||
nnoremap(']q', ':cnext<CR>')
|
nnoremap(']q', ':cnext<CR>')
|
||||||
|
|
||||||
|
-- no arrow keys
|
||||||
|
nnoremap("<up>", "<nop>")
|
||||||
|
nnoremap("<down>", "<nop>")
|
||||||
|
nnoremap("<left>", "<nop>")
|
||||||
|
nnoremap("<right>", "<nop>")
|
||||||
|
|
||||||
|
inoremap("<up>", "<nop>")
|
||||||
|
inoremap("<down>", "<nop>")
|
||||||
|
inoremap("<left>", "<nop>")
|
||||||
|
inoremap("<right>", "<nop>")
|
||||||
|
|
||||||
-- Tagbar
|
-- Tagbar
|
||||||
nnoremap('<Leader>hl', ':nohl<CR>')
|
nnoremap('<Leader>hl', ':nohl<CR>')
|
||||||
|
@ -7,7 +7,8 @@ local nnoremap = Remap.nnoremap
|
|||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
|
|
||||||
nnoremap("<leader>gg", function()
|
nnoremap("<leader>gg", function()
|
||||||
builtin.live_grep()
|
-- builtin.live_grep()
|
||||||
|
require "telescope".extensions.egrepify.egrepify { sorting_strategy = 'ascending' }
|
||||||
end)
|
end)
|
||||||
nnoremap("<C-p>", function()
|
nnoremap("<C-p>", function()
|
||||||
builtin.commands()
|
builtin.commands()
|
||||||
|
@ -1 +1,10 @@
|
|||||||
|
local vim = vim
|
||||||
|
local api = vim.api
|
||||||
|
|
||||||
vim.cmd([[autocmd TermOpen * setlocal nonumber norelativenumber]])
|
vim.cmd([[autocmd TermOpen * setlocal nonumber norelativenumber]])
|
||||||
|
|
||||||
|
local format_group = api.nvim_create_augroup("FormatGroup", { clear = true })
|
||||||
|
api.nvim_create_autocmd(
|
||||||
|
{ "BufWinEnter", "BufReadPost" },
|
||||||
|
{ pattern = "*", command = "normal zR", group = format_group }
|
||||||
|
)
|
||||||
|
@ -4,8 +4,8 @@ if vim.g.vscode then
|
|||||||
-- VSCode extension
|
-- VSCode extension
|
||||||
else
|
else
|
||||||
-- ordinary Neovim
|
-- ordinary Neovim
|
||||||
vim.notify = require("notify")
|
|
||||||
require("halfdan.lazy")
|
require("halfdan.lazy")
|
||||||
|
vim.notify = require("notify")
|
||||||
|
|
||||||
require("halfdan.neogit")
|
require("halfdan.neogit")
|
||||||
-- require("halfdan.neorg")
|
-- require("halfdan.neorg")
|
||||||
|
@ -11,8 +11,21 @@ if not vim.loop.fs_stat(lazypath) then
|
|||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
if vim.g.vscode then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{'TimUntersberger/neogit', dependencies = {'sindrets/diffview.nvim' } },
|
{
|
||||||
|
"NeogitOrg/neogit",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim", -- required
|
||||||
|
"nvim-telescope/telescope.nvim", -- optional
|
||||||
|
"sindrets/diffview.nvim", -- optional
|
||||||
|
"ibhagwan/fzf-lua", -- optional
|
||||||
|
},
|
||||||
|
config = true
|
||||||
|
},
|
||||||
{'airblade/vim-gitgutter'},
|
{'airblade/vim-gitgutter'},
|
||||||
|
|
||||||
-- Load .editorconfig files
|
-- Load .editorconfig files
|
||||||
@ -108,7 +121,7 @@ require("lazy").setup({
|
|||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
},
|
},
|
||||||
|
|
||||||
{'simrat39/symbols-outline.nvim'},
|
{'simrat39/symbols-outline.nvim', config=true},
|
||||||
{
|
{
|
||||||
'numToStr/Comment.nvim',
|
'numToStr/Comment.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
@ -119,6 +132,10 @@ require("lazy").setup({
|
|||||||
-- Telescope fuzzy find files/grep
|
-- Telescope fuzzy find files/grep
|
||||||
{'nvim-lua/popup.nvim'},
|
{'nvim-lua/popup.nvim'},
|
||||||
{'nvim-lua/plenary.nvim'},
|
{'nvim-lua/plenary.nvim'},
|
||||||
|
{
|
||||||
|
"fdschmidt93/telescope-egrepify.nvim",
|
||||||
|
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
|
||||||
|
},
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
{'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||||
{'nvim-telescope/telescope.nvim'},
|
{'nvim-telescope/telescope.nvim'},
|
||||||
{'nvim-telescope/telescope-dap.nvim'},
|
{'nvim-telescope/telescope-dap.nvim'},
|
||||||
@ -144,27 +161,27 @@ require("lazy").setup({
|
|||||||
"elixir-tools/elixir-tools.nvim",
|
"elixir-tools/elixir-tools.nvim",
|
||||||
version = "*",
|
version = "*",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
-- config = function()
|
config = function()
|
||||||
-- local elixir = require("elixir")
|
local elixir = require("elixir")
|
||||||
-- local elixirls = require("elixir.elixirls")
|
local elixirls = require("elixir.elixirls")
|
||||||
|
--
|
||||||
-- elixir.setup {
|
elixir.setup {
|
||||||
-- nextls = {enable = true},
|
nextls = {enable = false},
|
||||||
-- credo = {},
|
credo = {},
|
||||||
-- elixirls = {
|
elixirls = {
|
||||||
-- enable = false,
|
enable = true,
|
||||||
-- settings = elixirls.settings {
|
settings = elixirls.settings {
|
||||||
-- dialyzerEnabled = false,
|
dialyzerEnabled = false,
|
||||||
-- enableTestLenses = false,
|
enableTestLenses = false,
|
||||||
-- },
|
},
|
||||||
-- on_attach = function(client, bufnr)
|
on_attach = function()
|
||||||
-- vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
|
||||||
-- vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
|
||||||
-- vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
|
||||||
-- end,
|
end,
|
||||||
-- }
|
}
|
||||||
-- }
|
}
|
||||||
-- end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
|
@ -8,5 +8,5 @@ neogit.setup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nnoremap("<leader>gs", function()
|
nnoremap("<leader>gs", function()
|
||||||
neogit.open({ })
|
neogit.open({kind='split'})
|
||||||
end)
|
end)
|
||||||
|
@ -7,6 +7,26 @@ vim.o.titlestring="%<%F%=%l/%L - nvim"
|
|||||||
vim.wo.wrap = false -- Display long lines as just one line
|
vim.wo.wrap = false -- Display long lines as just one line
|
||||||
-- vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
|
-- vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
|
||||||
-- vim.cmd('syntax on') -- syntax highlighting
|
-- vim.cmd('syntax on') -- syntax highlighting
|
||||||
|
vim.o.foldmethod = "expr"
|
||||||
|
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||||
|
local fcs = vim.opt.fillchars:get()
|
||||||
|
|
||||||
|
-- Stolen from Akinsho
|
||||||
|
local function get_fold(lnum)
|
||||||
|
if vim.fn.foldlevel(lnum) <= vim.fn.foldlevel(lnum - 1) then return ' ' end
|
||||||
|
return vim.fn.foldclosed(lnum) == -1 and fcs.foldopen or fcs.foldclose
|
||||||
|
end
|
||||||
|
|
||||||
|
_G.get_statuscol = function()
|
||||||
|
return "%s%=" .. get_fold(vim.v.lnum) .. " %l "
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
vim.o.statuscolumn = "%!v:lua.get_statuscol()"
|
||||||
|
vim.o.foldcolumn = '0'
|
||||||
|
vim.o.foldlevelstart = 99
|
||||||
|
vim.o.foldlevel = 99 -- Keep folds open by default
|
||||||
vim.o.pumheight = 10 -- Makes popup menu smaller
|
vim.o.pumheight = 10 -- Makes popup menu smaller
|
||||||
vim.o.fileencoding = "utf-8" -- The encoding written to file
|
vim.o.fileencoding = "utf-8" -- The encoding written to file
|
||||||
vim.o.cmdheight = 1 -- More space for displaying messages
|
vim.o.cmdheight = 1 -- More space for displaying messages
|
||||||
@ -21,7 +41,7 @@ vim.o.shiftwidth = 2 -- Change the number of space characters inserted for inden
|
|||||||
vim.o.expandtab = true -- Converts tabs to spaces
|
vim.o.expandtab = true -- Converts tabs to spaces
|
||||||
vim.bo.smartindent = false -- Makes indenting smart
|
vim.bo.smartindent = false -- Makes indenting smart
|
||||||
vim.wo.number = true -- set numbered lines
|
vim.wo.number = true -- set numbered lines
|
||||||
vim.wo.relativenumber = true -- set relative number
|
-- vim.wo.relativenumber = true -- set relative number
|
||||||
vim.wo.cursorline = true -- Enable highlighting of the current line
|
vim.wo.cursorline = true -- Enable highlighting of the current line
|
||||||
vim.o.showtabline = 1 -- Always show tabs
|
vim.o.showtabline = 1 -- Always show tabs
|
||||||
vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
||||||
|
@ -64,3 +64,4 @@ require("telescope").load_extension("git_worktree")
|
|||||||
require('telescope').load_extension("fzf")
|
require('telescope').load_extension("fzf")
|
||||||
require('telescope').load_extension("dap")
|
require('telescope').load_extension("dap")
|
||||||
require('telescope').load_extension("smart_open")
|
require('telescope').load_extension("smart_open")
|
||||||
|
require('telescope').load_extension("egrepify")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user