-
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
156 changed files
with
17,338 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
vim.opt_local.path = "/usr/include/**,/usr/local/include/**,/lib/clang/**" | ||
|
||
if vim.bo.filetype ~= "c" then return end | ||
if vim.fn.executable "clang-format" == 1 then | ||
vim.opt_local.formatprg = "clang-format --assume-filename=.c" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if vim.bo.filetype ~= "cpp" then return end | ||
if vim.fn.executable "clang-format" == 1 then | ||
vim.opt_local.formatprg = "clang-format --assume-filename=.cpp" | ||
end | ||
|
||
vim.bo.commentstring = '// %s' | ||
vim.opt_local.cinkeys:remove ":" |
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,4 @@ | ||
if vim.bo.filetype ~= "gitcommit" then return end | ||
|
||
vim.opt_local.textwidth = 72 | ||
vim.opt_local.formatoptions:remove({ "c", "r", "o", "q" }) |
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,4 @@ | ||
if vim.bo.filetype ~= "gitconfig" then return end | ||
|
||
vim.opt_local.comments = ":#" | ||
vim.opt_local.commentstring = "# %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,21 @@ | ||
if vim.bo.filetype ~= "help" then return end | ||
vim.api.nvim_create_autocmd("BufWinEnter", { | ||
callback = function(event) | ||
if vim.bo.filetype == "help" then | ||
vim.bo[event.buf].buflisted = true | ||
vim.bo[event.buf].modifiable = true | ||
vim.bo[event.buf].readonly = false | ||
vim.api.nvim_exec2("wincmd L", {}) | ||
end | ||
end | ||
}) | ||
|
||
vim.api.nvim_create_autocmd("BufWritePost", { | ||
callback = function() | ||
if vim.bo.filetype == "help" then | ||
local file_path = vim.fn.expand("%:p") | ||
-- Async (vim.system) doesn't play well with expand. | ||
vim.fn.system("chezmoi re-add " .. file_path) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if vim.bo.filetype ~= "json" then return end | ||
if vim.fn.executable "clang-format" == 1 then | ||
vim.opt_local.formatprg = "clang-format --assume-filename=.json" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
if vim.bo.filetype ~= "lua" then return end | ||
if vim.fn.executable "stylua" == 1 then | ||
vim.opt_local.formatprg = "stylua -" | ||
end | ||
vim.bo.comments = ":---,:--" | ||
|
||
vim.b.miniai_config = { | ||
custom_textobjects = { | ||
s = { | ||
"%[%[().-()%]%]", | ||
}, | ||
}, | ||
} | ||
|
||
vim.b.minisurround_config = { | ||
custom_surroundings = { | ||
s = { | ||
input = { | ||
"%[%[().-()%]%]", | ||
}, | ||
output = { | ||
left = "[[", | ||
right = "]]", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
if _G.MiniSplitjoin ~= nil then | ||
local gen_hook = MiniSplitjoin.gen_hook | ||
local curly = { | ||
brackets = { | ||
"%b{}", | ||
}, | ||
} | ||
|
||
-- Add trailing comma when splitting inside curly brackets | ||
local add_comma_curly = gen_hook.add_trailing_separator(curly) | ||
|
||
-- Delete trailing comma when joining inside curly brackets | ||
local del_comma_curly = gen_hook.del_trailing_separator(curly) | ||
|
||
-- Pad curly brackets with single space after join | ||
local pad_curly = gen_hook.pad_brackets(curly) | ||
|
||
vim.b.minisplitjoin_config = { | ||
split = { | ||
hooks_post = { | ||
add_comma_curly, | ||
}, | ||
}, | ||
join = { | ||
hooks_post = { | ||
del_comma_curly, | ||
pad_curly, | ||
}, | ||
}, | ||
} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if vim.bo.filetype ~= "man" then return end | ||
vim.api.nvim_create_autocmd("BufWinEnter", { | ||
callback = function(event) | ||
if vim.bo.filetype == "man" then | ||
vim.bo[event.buf].buflisted = false | ||
vim.api.nvim_exec2("wincmd L", {}) | ||
vim.keymap.set("n", "q", "<cmd>q<cr>", { buffer = event.buf, silent = true }) | ||
end | ||
end, | ||
}) |
Oops, something went wrong.