-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
285 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
local map = vim.keymap.set | ||
|
||
return function() | ||
map({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) -- space is my leader key | ||
map('n', 'Q', '<Nop>', { silent = true }) | ||
map('i', 'kk', '<Esc>') -- Better feeling exit insert mode | ||
map('t', '<C-/><C-/>', '<C-\\><C-n>') -- Better feeling exit term mode | ||
map({ 'n', 'v' }, "<leader>y", [["+y]]) -- Access system clipboard | ||
map('n', "<leader>Y", [["+Y]]) | ||
map('n', "<leader>pp", [["+p]], { desc = '[P]aste system clipboard' }) | ||
map('v', "<leader>p", [["_dP]]) -- Dont overwrite after pasting over text | ||
map({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) -- space is my leader key | ||
map('n', 'Q', '<Nop>', { silent = true }) | ||
map('i', 'kk', '<Esc>') -- Better feeling exit insert mode | ||
map('t', '<C-/><C-/>', '<C-\\><C-n>') -- Better feeling exit term mode | ||
map({ 'n', 'v' }, "<leader>y", [["+y]]) -- Access system clipboard | ||
map('n', "<leader>Y", [["+Y]]) | ||
map('n', "<leader>pp", [["+p]], { desc = '[P]aste system clipboard' }) | ||
map('v', "<leader>p", [["_dP]]) -- Dont overwrite after pasting over text | ||
|
||
-- sorting paragraphs | ||
map('v', '<leader>s', '!sort<CR>', { desc = '[S]ort highlighted' }) | ||
map('v', '<leader>gs', '!sort -r<CR>', { desc = 'reverse [S]ort highlighted' }) | ||
-- sorting paragraphs | ||
map('v', '<leader>s', '!sort<CR>', { desc = '[S]ort highlighted' }) | ||
map('v', '<leader>gs', '!sort -r<CR>', { desc = 'reverse [S]ort highlighted' }) | ||
|
||
map('n', '<leader>dt', '<CMD>r!date -u \'+\\%F \\%T\'<CR>', { desc = 'insert [D]ate [T]ime' }) | ||
map('n', '<leader>dt', '<CMD>r!date -u \'+\\%F \\%T\'<CR>', { desc = 'insert [D]ate [T]ime' }) | ||
|
||
map('n', '<C-h>', "<C-w><C-h>") -- split movement | ||
map('n', '<C-j>', "<C-w><C-j>") | ||
map('n', '<C-k>', "<C-w><C-k>") | ||
map('n', '<C-l>', "<C-w><C-l>") | ||
map('n', '<C-h>', "<C-w><C-h>") -- split movement | ||
map('n', '<C-j>', "<C-w><C-j>") | ||
map('n', '<C-k>', "<C-w><C-k>") | ||
map('n', '<C-l>', "<C-w><C-l>") | ||
|
||
map('n', "<C-,>", "<c-w>5<") -- split resizing | ||
map('n', "<C-.>", "<c-w>5>") | ||
map('n', "<C-t>", "<C-W>+") | ||
map('n', "<C-s>", "<C-W>-") | ||
map('n', "<C-=>", "<C-W>=") | ||
map('n', "<C-,>", "<c-w>5<") -- split resizing | ||
map('n', "<C-.>", "<c-w>5>") | ||
map('n', "<C-t>", "<C-W>+") | ||
map('n', "<C-s>", "<C-W>-") | ||
map('n', "<C-=>", "<C-W>=") | ||
|
||
-- Diagnostic keymaps | ||
map('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) | ||
map('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) | ||
map('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) | ||
map('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
return function() | ||
vim.o.breakindent = true -- Enable break indent | ||
vim.o.expandtab = true | ||
vim.o.hlsearch = false -- highlight on search | ||
vim.o.ignorecase = true -- Case-insensitive searching UNLESS \C or capital in search | ||
vim.opt.colorcolumn = { 100 } | ||
vim.o.shiftwidth = 2 | ||
vim.o.showtabline = 0 | ||
vim.o.smartcase = true | ||
vim.o.softtabstop = 2 | ||
vim.o.splitbelow = true | ||
vim.o.splitright = true | ||
vim.o.tabstop = 2 | ||
vim.wo.number = true -- Make line numbers default and relative | ||
vim.wo.relativenumber = true | ||
vim.wo.signcolumn = 'no' -- Keep signcolumn on by default | ||
vim.o.shell = "fish" | ||
vim.o.termguicolors = true -- NOTE: make sure your terminal supports this | ||
--[[ | ||
[!IMPORTANT] | ||
The next line is a wezterm/neovim display update bug workaround for using nvim in a wezterm mux | ||
server. see [this issue](https://github.com/wez/wezterm/issues/4607 ) for more info. Also look | ||
at `.../ansible/1-active-quests/hix/nvim-nix-rewrite.md` for more info as well. The bug should | ||
be fixed when the fix linked in issue 4607 above is merged into main, and I believe the nightly | ||
version of wezterm already includes it. | ||
]] | ||
vim.opt.termsync = false | ||
vim.o.updatetime = 250 -- Decrease update time | ||
vim.o.timeoutlen = 300 | ||
vim.o.undofile = true -- Save undo history | ||
vim.o.breakindent = true -- Enable break indent | ||
vim.o.expandtab = true | ||
vim.o.hlsearch = false -- highlight on search | ||
vim.o.ignorecase = true -- Case-insensitive searching UNLESS \C or capital in search | ||
vim.opt.colorcolumn = { 100 } | ||
vim.o.shiftwidth = 4 | ||
vim.o.showtabline = 0 | ||
vim.o.smartcase = true | ||
vim.o.softtabstop = 4 | ||
vim.o.splitbelow = true | ||
vim.o.splitright = true | ||
vim.o.tabstop = 4 | ||
vim.wo.number = true -- Make line numbers default and relative | ||
vim.wo.relativenumber = true | ||
vim.wo.signcolumn = 'no' -- Keep signcolumn on by default | ||
vim.o.shell = "fish" | ||
vim.o.termguicolors = true -- NOTE: make sure your terminal supports this | ||
--[[ | ||
[!IMPORTANT] | ||
The next line is a wezterm/neovim display update bug workaround for using nvim in a wezterm mux | ||
server. see [this issue](https://github.com/wez/wezterm/issues/4607 ) for more info. Also look | ||
at `.../ansible/1-active-quests/hix/nvim-nix-rewrite.md` for more info as well. The bug should | ||
be fixed when the fix linked in issue 4607 above is merged into main, and I believe the nightly | ||
version of wezterm already includes it. | ||
]] | ||
vim.opt.termsync = false | ||
vim.o.updatetime = 250 -- Decrease update time | ||
vim.o.timeoutlen = 300 | ||
vim.o.undofile = true -- Save undo history | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
return { | ||
{ "rose-pine/neovim", name = "rose-pine" }, | ||
{ | ||
"water-sucks/darkrose.nvim", | ||
lazy = false, | ||
priority = 1000, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,42 @@ | ||
require('luasnip.session.snippet_collection').clear_snippets "lua" | ||
|
||
---@diagnostic disable: unused-local | ||
require('luasnip.session.snippet_collection').clear_snippets "all" | ||
local ls = require 'luasnip' | ||
local s = ls.snippet | ||
local t = ls.text_node | ||
local i = ls.insert_node | ||
local c = ls.choice_node | ||
local f = ls.function_node | ||
local extras = require 'luasnip.extras' | ||
local rep = extras.rep | ||
local fmt = require("luasnip.extras.fmt").fmt | ||
local u = require 'handdara.snippets.util' | ||
|
||
-- local bchoose = [[Choose your weapon: {}]] | ||
-- local weapons = { | ||
-- t('sword'), | ||
-- t('gun'), | ||
-- t('spell'), | ||
-- t('beer'), | ||
-- } | ||
-- local schoose = s("choose", | ||
-- fmt(bchoose, { c(1, weapons) }) | ||
-- ) | ||
|
||
local sdate = s("date", { | ||
f(function() | ||
local ts = u.timestamp() | ||
return ts.dy .. ts.mo .. ts.yr | ||
end), | ||
}) | ||
|
||
local sdatetime = s("datetime", { | ||
f(function() | ||
local ts = u.timestamp() | ||
return ts.dy .. ts.mo .. ts.yr .. ' ' .. ts.hr .. ts.mi | ||
end), | ||
}) | ||
|
||
ls.add_snippets("lua", { | ||
s("hello", { | ||
t('print("hello '), | ||
i(1), | ||
t('. What a great '), | ||
i(2), | ||
t('!")'), | ||
}) | ||
ls.add_snippets("all", { | ||
sdate, | ||
sdatetime, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
---@diagnostic disable: unused-local | ||
require('luasnip.session.snippet_collection').clear_snippets "lua" | ||
local ls = require 'luasnip' | ||
local s = ls.snippet | ||
local t = ls.text_node | ||
local i = ls.insert_node | ||
local c = ls.choice_node | ||
local f = ls.function_node | ||
local d = ls.dynamic_node | ||
local extras = require 'luasnip.extras' | ||
local rep = extras.rep | ||
local fmt = require("luasnip.extras.fmt").fmt | ||
local u = require 'handdara.snippets.util' | ||
|
||
local bsnipfile = [[ | ||
---@diagnostic disable: unused-local | ||
require('luasnip.session.snippet_collection').clear_snippets "{}" | ||
local ls = require 'luasnip' | ||
local s = ls.snippet | ||
local t = ls.text_node | ||
local i = ls.insert_node | ||
local c = ls.choice_node | ||
local f = ls.function_node | ||
local d = ls.dynamic_node | ||
local extras = require 'luasnip.extras' | ||
local rep = extras.rep | ||
local fmt = require("luasnip.extras.fmt").fmt | ||
local u = require 'handdara.snippets.util' | ||
ls.add_snippets("{}", {{ | ||
{}, | ||
}}) | ||
]] | ||
|
||
ls.add_snippets("lua", { | ||
s("luasnipfile", fmt(bsnipfile, {i(1), rep(1), i(0)} )) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
---@diagnostic disable: unused-local | ||
require('luasnip.session.snippet_collection').clear_snippets "markdown" | ||
local ls = require 'luasnip' | ||
local s = ls.snippet | ||
local t = ls.text_node | ||
local i = ls.insert_node | ||
local c = ls.choice_node | ||
local f = ls.function_node | ||
local d = ls.dynamic_node | ||
local extras = require 'luasnip.extras' | ||
local rep = extras.rep | ||
local fmt = require("luasnip.extras.fmt").fmt | ||
local u = require 'handdara.snippets.util' | ||
|
||
|
||
|
||
ls.add_snippets("markdown", { | ||
-- s, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
---@diagnostic disable: unused-local | ||
require('luasnip.session.snippet_collection').clear_snippets "matlab" | ||
local ls = require 'luasnip' | ||
local s = ls.snippet | ||
local t = ls.text_node | ||
local i = ls.insert_node | ||
local c = ls.choice_node | ||
local f = ls.function_node | ||
local d = ls.dynamic_node | ||
local extras = require 'luasnip.extras' | ||
local rep = extras.rep | ||
local fmt = require("luasnip.extras.fmt").fmt | ||
local u = require 'handdara.snippets.util' | ||
|
||
ls.add_snippets("matlab", { | ||
}) |
Oops, something went wrong.