Compare commits
No commits in common. "7b66e265111bc556ba2d97b823f47de47d4ff2c9" and "f6127cf54bdc4317832e314a12e140d5b705eca3" have entirely different histories.
7b66e26511
...
f6127cf54b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
||||
lazy-lock.json
|
||||
spell/
|
||||
|
@ -1,5 +1,11 @@
|
||||
local markdown = vim.api.nvim_create_augroup("markdown", { clear = true })
|
||||
local spelling = vim.api.nvim_create_augroup("spelling", { clear = true })
|
||||
|
||||
local keyunmap = function(mode, binding)
|
||||
print(vim.inspect(vim.fn.maparg(binding, mode)))
|
||||
if vim.fn.maparg(binding, mode) ~= "" then
|
||||
vim.keymap.del(mode, binding)
|
||||
end
|
||||
end
|
||||
|
||||
-- Recognize .md as pandoc
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
@ -9,7 +15,6 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
vim.o.filetype = 'pandoc'
|
||||
require('luasnip').filetype_extend("pandoc", { "markdown" })
|
||||
vim.o.spell = true
|
||||
require('spelling').spell_keymap()
|
||||
vim.o.spelllang = 'en'
|
||||
vim.o.formatoptions = "qj"
|
||||
-- email commands: my/msy to paste the html inside the clipboard
|
||||
@ -32,15 +37,23 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
-- Spell shortcuts
|
||||
vim.api.nvim_create_autocmd({ "OptionSet" }, {
|
||||
pattern = { "spell" },
|
||||
group = spelling,
|
||||
callback = require('spelling').spell_keymap
|
||||
group = markdown,
|
||||
callback = function()
|
||||
if vim.o.spell == true then
|
||||
vim.keymap.set("n", "<Leader>i", "mz[s1z=`z", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "à", "]s", { noremap = true, silent = true })
|
||||
else
|
||||
keyunmap("n", "<Leader>i")
|
||||
keyunmap("n", "à")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- LaTeX configuration
|
||||
local texgroup = vim.api.nvim_create_augroup("latex", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "latex", "tex" },
|
||||
pattern = { "latex" },
|
||||
group = texgroup,
|
||||
callback = function()
|
||||
-- vimtex configuration
|
||||
@ -54,6 +67,5 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
|
||||
vim.o.foldtext = 'vimtex#fold#text()'
|
||||
vim.o.spell = true
|
||||
require('spelling').spell_keymap()
|
||||
end,
|
||||
})
|
||||
|
@ -140,17 +140,11 @@ require('lazy').setup({
|
||||
-- See `:help lualine.txt`
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
icons_enabled = false,
|
||||
theme = 'rose-pine',
|
||||
component_separators = '|',
|
||||
section_separators = '',
|
||||
},
|
||||
symbols = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
info = " ",
|
||||
hint = " ",
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -81,7 +81,6 @@ local servers = {
|
||||
tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
texlab = {},
|
||||
ltex = {},
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
@ -118,7 +117,8 @@ mason_lspconfig.setup_handlers {
|
||||
end,
|
||||
}
|
||||
|
||||
-- [[ System LSPs ]]
|
||||
-- System LSPs
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
servers = {
|
||||
rust_analyzer = {
|
||||
|
@ -1,19 +0,0 @@
|
||||
local keyunmap = function(mode, binding)
|
||||
if vim.fn.maparg(binding, mode) ~= "" then
|
||||
vim.keymap.del(mode, binding)
|
||||
end
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
M.spell_keymap = function()
|
||||
if vim.o.spell == true then
|
||||
vim.keymap.set("n", "<Leader>i", "mzl[s1z=`z", { noremap = true, silent = true, desc = "f[I]x typo under cursor" })
|
||||
vim.keymap.set("n", "à", "]s", { noremap = true, silent = true, desc = "Go to the next typo" })
|
||||
else
|
||||
keyunmap("n", "<Leader>i")
|
||||
keyunmap("n", "à")
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
@ -1,11 +1,9 @@
|
||||
In this repository lies my Neovim configuration starting from
|
||||
In this repository lies my nvim configuration starting from
|
||||
[kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim).
|
||||
|
||||
The provided `init.lua` file has then been split into (tryingly) semantically
|
||||
consistent files inside `lua/` and personal customizations have been applied.
|
||||
|
||||
The process to design this configuration and some thoughts can be found [here](https://blog.epheme.re/software/nvim-kickstart.html).
|
||||
|
||||
## Testing it
|
||||
|
||||
To try it, you can use the `NVIM_APPNAME` environment variable:
|
||||
|
Loading…
Reference in New Issue
Block a user