feat(nvim): dynamic listchars
This commit is contained in:
parent
42a61a77a8
commit
94d6215b1f
@ -1,6 +1,5 @@
|
|||||||
-- variables
|
-- variables
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
vim.opt_local.tabstop = 2
|
vim.opt_local.tabstop = 2
|
||||||
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
|
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
-- variables
|
-- variables
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
vim.opt_local.tabstop = 2
|
vim.opt_local.tabstop = 2
|
||||||
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
|
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
-- variables
|
-- variables
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
vim.opt_local.tabstop = 2
|
vim.opt_local.tabstop = 2
|
||||||
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
|
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
-- variables
|
-- variables
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
vim.opt_local.tabstop = 2
|
vim.opt_local.tabstop = 2
|
||||||
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
|
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
-- variables
|
-- variables
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
vim.opt_local.tabstop = 2
|
vim.opt_local.tabstop = 2
|
||||||
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
|
|
||||||
vim.opt_local.spelllang = "fr"
|
vim.opt_local.spelllang = "fr"
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
-- variables
|
-- variables
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
vim.opt_local.tabstop = 2
|
vim.opt_local.tabstop = 2
|
||||||
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
|
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
@ -4,45 +4,47 @@
|
|||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
vim.o.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.o.smartindent = true
|
vim.opt.smartindent = true
|
||||||
vim.o.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.o.tabstop = 4
|
vim.opt.tabstop = 4
|
||||||
vim.o.cino = "(s"
|
vim.opt.cino = "(s"
|
||||||
vim.g.python_indent = {
|
vim.g.python_indent = { open_paren = "shiftwidth()" }
|
||||||
open_paren = "shiftwidth()"
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.o.list = true
|
vim.opt.list = true
|
||||||
vim.o.listchars = "tab:> ,trail:-,nbsp:+,leadmultispace:│ "
|
--vim.opt.listchars = {
|
||||||
|
-- tab = "> ",
|
||||||
|
-- trail = "-",
|
||||||
|
-- nbsp = "+",
|
||||||
|
--}
|
||||||
|
|
||||||
vim.o.number = true
|
vim.opt.number = true
|
||||||
vim.o.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
vim.o.laststatus = 3
|
vim.opt.laststatus = 3
|
||||||
|
|
||||||
vim.o.ignorecase = true
|
vim.opt.ignorecase = true
|
||||||
vim.o.smartcase = true
|
vim.opt.smartcase = true
|
||||||
|
|
||||||
vim.o.guicursor = ""
|
vim.opt.guicursor = ""
|
||||||
vim.o.mousemodel = extend
|
vim.opt.mousemodel = extend
|
||||||
|
|
||||||
vim.o.path = vim.o.path .. ",**"
|
vim.opt.path = vim.o.path .. ",**"
|
||||||
vim.o.suffixes = vim.o.suffixes .. ",.pyc,.hi"
|
vim.opt.suffixes = vim.o.suffixes .. ",.pyc,.hi"
|
||||||
|
|
||||||
vim.o.foldmethod = "indent"
|
vim.opt.foldmethod = "indent"
|
||||||
vim.o.foldlevel = 99
|
vim.opt.foldlevel = 99
|
||||||
|
|
||||||
vim.o.grepprg = "grep -rn"
|
vim.opt.grepprg = "grep -rn"
|
||||||
|
|
||||||
vim.o.scrolloff = 2
|
vim.opt.scrolloff = 2
|
||||||
vim.wo.colorcolumn = "80"
|
vim.opt.colorcolumn = "80"
|
||||||
|
|
||||||
vim.g.netrw_banner = 0
|
vim.g.netrw_banner = 0
|
||||||
vim.g.netrw_list_hide = "\\.o$,\\.d$,\\.gc..$"
|
vim.g.netrw_list_hide = "\\.o$,\\.d$,\\.gc..$"
|
||||||
|
|
||||||
vim.o.lazyredraw = true
|
vim.opt.lazyredraw = true
|
||||||
|
|
||||||
vim.o.complete = vim.o.complete .. ",i"
|
vim.opt.complete = vim.o.complete .. ",i"
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
----- packages -----
|
----- packages -----
|
||||||
@ -67,3 +69,12 @@ require"pack-treesitter"
|
|||||||
vim.keymap.set("n", "<Leader>f", "<cmd>%s/\\s\\+$//e<CR>")
|
vim.keymap.set("n", "<Leader>f", "<cmd>%s/\\s\\+$//e<CR>")
|
||||||
vim.keymap.set("n", "n", "nzz")
|
vim.keymap.set("n", "n", "nzz")
|
||||||
vim.keymap.set("n", "N", "Nzz")
|
vim.keymap.set("n", "N", "Nzz")
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
----- autocommands -----
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWinEnter" }, { callback = function()
|
||||||
|
vim.opt_local.listchars = vim.o.listchars ..
|
||||||
|
",leadmultispace:│" .. string.rep(" ", vim.o.shiftwidth - 1)
|
||||||
|
end })
|
||||||
|
@ -4,5 +4,5 @@ vim.keymap.set("n", "ga", "<Plug>(EasyAlign)")
|
|||||||
vim.keymap.set("x", "ga", "<Plug>(EasyAlign)")
|
vim.keymap.set("x", "ga", "<Plug>(EasyAlign)")
|
||||||
|
|
||||||
vim.g.easy_align_delimiters = {
|
vim.g.easy_align_delimiters = {
|
||||||
["\\"] = {["pattern"] = "\\\\$"}
|
["\\"] = { ["pattern"] = "\\\\$" }
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
vim.cmd("packadd treesitter")
|
vim.cmd("packadd treesitter")
|
||||||
require"nvim-treesitter.configs".setup {
|
require"nvim-treesitter.configs".setup {
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {enable = true},
|
highlight = { enable = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.cmd("TSUpdate")
|
vim.cmd("TSUpdate")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
vim.cmd("packadd onedark")
|
vim.cmd("packadd onedark")
|
||||||
require"onedark".setup {
|
local theme = require"onedark"
|
||||||
|
theme.setup {
|
||||||
style = "dark",
|
style = "dark",
|
||||||
transparent = true
|
transparent = true
|
||||||
}
|
}
|
||||||
require"onedark".load()
|
theme.load()
|
||||||
|
Loading…
Reference in New Issue
Block a user