]> git.madduck.net Git - etc/neovim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Import options from vimrc
authormartin f. krafft <madduck@madduck.net>
Wed, 9 Apr 2025 11:57:02 +0000 (13:57 +0200)
committermartin f. krafft <madduck@madduck.net>
Thu, 17 Apr 2025 06:33:01 +0000 (08:33 +0200)
.config/nvim/init.lua
.config/nvim/keymaps.lua
.config/nvim/options.lua
.gitignore.d/neovim

index 03c40f10437cda74eb556c44e58355cad36dee2b..b6f4e03cd062b5388e12856b47e9bb8c117f48b3 100644 (file)
@@ -1,50 +1,52 @@
 vim.g.statedir = vim.fn.expand("~/.local/state/nvim/")
 vim.g.statedir = vim.fn.expand("~/.local/state/nvim/")
-vim.g.mapleader = ';'
-vim.g.maplocalleader = ';'
+vim.g.mapleader = ";"
+vim.g.maplocalleader = ";"
 
 vim.g.netrw_home = vim.g.statedir .. "netrw"
 
 
 vim.g.netrw_home = vim.g.statedir .. "netrw"
 
-vim.cmd.runtime 'options.lua'
-vim.cmd.runtime 'keymaps.lua'
-vim.cmd.runtime 'style.vim'
-vim.cmd.runtime 'emojis.vim'
+vim.cmd.runtime("options.lua")
+vim.cmd.runtime("keymaps.lua")
+vim.cmd.runtime("style.vim")
+vim.cmd.runtime("emojis.vim")
 
 
-vim.cmd 'packadd! gnupg'
+vim.cmd("packadd! gnupg")
 
 
-vim.call "plug#begin"
+vim.call("plug#begin")
 
 
-local Plug = vim.fn['plug#']
+local Plug = vim.fn["plug#"]
 
 -- My preferred colour scheme
 
 -- My preferred colour scheme
-Plug 'wimstefan/vim-artesanal'
+Plug("wimstefan/vim-artesanal")
 
 -- Git operations from within files
 
 -- Git operations from within files
-Plug 'tpope/vim-fugitive'
+Plug("tpope/vim-fugitive")
 
 -- Detect tabstop and shiftwidth automatically
 
 -- Detect tabstop and shiftwidth automatically
-Plug 'tpope/vim-sleuth'
+Plug("tpope/vim-sleuth")
 
 -- Markdown support, which requires tabular.
 
 -- Markdown support, which requires tabular.
-Plug 'godlygeek/tabular'
-Plug 'preservim/vim-markdown'
+Plug("godlygeek/tabular")
+Plug("preservim/vim-markdown")
 
 -- ExplainPattern to visualise/help with Vim regular expressions
 
 -- ExplainPattern to visualise/help with Vim regular expressions
-Plug 'Houl/ExplainPattern-vim'
+Plug("Houl/ExplainPattern-vim")
 
 -- Remember the last editing position
 
 -- Remember the last editing position
-Plug 'farmergreg/vim-lastplace'
+Plug("farmergreg/vim-lastplace")
 
 
-Plug 'neovim/nvim-lspconfig'
-Plug 'dense-analysis/ale'
+Plug("neovim/nvim-lspconfig")
+Plug("dense-analysis/ale")
 
 
-vim.call "plug#end"
+vim.call("plug#end")
 
 function hasPlug(plugin)
 
 function hasPlug(plugin)
-  return vim.g.plugs[plugin] ~= nil
+       return vim.g.plugs[plugin] ~= nil
 end
 
 function prequire(m)
 end
 
 function prequire(m)
-  local ok, err = pcall(require, m)
-  if not ok then return nil, err end
-  return err
+       local ok, err = pcall(require, m)
+       if not ok then
+               return nil, err
+       end
+       return err
 end
 end
index 891ea02c38983fbbc0e3b1be1eba99d8b16e199b..1fc938dacbd4bd14f9affb80a694c273fbeaaf09 100644 (file)
@@ -1,12 +1,16 @@
 -- this isn't windows, screw the F1->help key
 -- this isn't windows, screw the F1->help key
-vim.keymap.set({'n', 'v', 'o', 'i'}, '<F1>', '<Esc>')
+vim.keymap.set({ "n", "v", "o", "i" }, "<F1>", "<Esc>")
 
 -- toggle paste mode with F2
 
 -- toggle paste mode with F2
-vim.keymap.set({'n', 'v', 'o', 'i'}, '<F2>', ':set invpaste<CR>')
+vim.keymap.set({ "n", "v", "o", "i" }, "<F2>", "<cmd>set invpaste<CR>")
 
 -- clear highlights on search when pressing <Esc> in normal mode
 
 -- clear highlights on search when pressing <Esc> in normal mode
-vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
+vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
 
 -- Pop-up menu navigation with tab
 
 -- Pop-up menu navigation with tab
-vim.keymap.set('i', '<Tab>', function() return vim.fn.pumvisible() and "<C-n>" or "<Tab>" end, {expr = true, remap = false})
-vim.keymap.set('i', '<S-Tab>', function() return vim.fn.pumvisible() and "<C-p>" or "<S-Tab>" end, {expr = true, remap = false})
+vim.keymap.set("i", "<Tab>", function()
+       return vim.fn.pumvisible() and "<C-n>" or "<Tab>"
+end, { expr = true, remap = false })
+vim.keymap.set("i", "<S-Tab>", function()
+       return vim.fn.pumvisible() and "<C-p>" or "<S-Tab>"
+end, { expr = true, remap = false })
index 1165c343e6d7ada3832d8c1ff3e9075553813a6a..206327ffb7b747940124bc92e7ebf939ad414601 100644 (file)
@@ -13,17 +13,17 @@ vim.opt.smartcase = true
 -----------------------------------------------------------------------------
 
 -- "dark" or "light"; the background color brightness
 -----------------------------------------------------------------------------
 
 -- "dark" or "light"; the background color brightness
-vim.opt.background = 'light'
+vim.opt.background = "light"
 
 -----------------------------------------------------------------------------
 --- messages and info
 -----------------------------------------------------------------------------
 
 -- list of flags to make messages shorter
 
 -----------------------------------------------------------------------------
 --- messages and info
 -----------------------------------------------------------------------------
 
 -- list of flags to make messages shorter
-vim.opt.shortmess = 'atTWoOI'
+vim.opt.shortmess = "atTWoOI"
 
 -- display the current mode in the status line
 
 -- display the current mode in the status line
-vim.opt.showmode = false  -- the cursor already reflects the mode
+vim.opt.showmode = false -- the cursor already reflects the mode
 
 -- do not display a status line unless there is more than one window
 vim.opt.laststatus = 1
 
 -- do not display a status line unless there is more than one window
 vim.opt.laststatus = 1
@@ -43,14 +43,14 @@ vim.opt.breakindent = true
 vim.opt.textwidth = 78
 
 -- list of flags that tell how automatic formatting works
 vim.opt.textwidth = 78
 
 -- list of flags that tell how automatic formatting works
-vim.opt.formatoptions = 'tcroqn1l'
+vim.opt.formatoptions = "tcroqn1l"
 
 -- pattern to recognize a numbered list
 -- [[…]] is the Lua way to disable escape sequences in strings
 vim.opt.formatlistpat = [[^\v\s*(((#|\a|\d{,4}|[ivx]{,4})[]:.)}/])+|[-\*.·→+])\s+]]
 
 -- whether to use a popup menu for Insert mode completion
 
 -- pattern to recognize a numbered list
 -- [[…]] is the Lua way to disable escape sequences in strings
 vim.opt.formatlistpat = [[^\v\s*(((#|\a|\d{,4}|[ivx]{,4})[]:.)}/])+|[-\*.·→+])\s+]]
 
 -- whether to use a popup menu for Insert mode completion
-vim.opt.completeopt = { 'menu', 'noinsert', 'popup', 'preview' }
+vim.opt.completeopt = { "menu", "noinsert", "popup", "preview" }
 
 -- number of spaces used for each step of (auto)indent
 vim.opt.shiftwidth = 2
 
 -- number of spaces used for each step of (auto)indent
 vim.opt.shiftwidth = 2
@@ -75,7 +75,7 @@ vim.opt.undofile = true
 -----------------------------------------------------------------------------
 
 -- folding type: "manual", "indent", "expr", "marker", "syntax" or "diff"
 -----------------------------------------------------------------------------
 
 -- folding type: "manual", "indent", "expr", "marker", "syntax" or "diff"
-vim.opt.foldmethod = 'marker'
+vim.opt.foldmethod = "marker"
 
 -----------------------------------------------------------------------------
 --- reading and writing files
 
 -----------------------------------------------------------------------------
 --- reading and writing files
@@ -95,14 +95,14 @@ vim.opt.autoread = true
 -----------------------------------------------------------------------------
 
 -- list of directories for the swap file
 -----------------------------------------------------------------------------
 
 -- list of directories for the swap file
-vim.opt.directory = { '.', vim.g.statedir .. '/swap//', '/var/tmp//', '$TMPDIR//', '/tmp//' }
+vim.opt.directory = { ".", vim.g.statedir .. "/swap//", "/var/tmp//", "$TMPDIR//", "/tmp//" }
 
 -----------------------------------------------------------------------------
 --- command line editing
 -----------------------------------------------------------------------------
 
 -- list of patterns to ignore files for file name completion
 
 -----------------------------------------------------------------------------
 --- command line editing
 -----------------------------------------------------------------------------
 
 -- list of patterns to ignore files for file name completion
-vim.opt.wildignore = { '*.o', '*.pyc', '*.pyo', '*~', '*.bk', '*.bak' }
+vim.opt.wildignore = { "*.o", "*.pyc", "*.pyo", "*~", "*.bk", "*.bak" }
 
 -----------------------------------------------------------------------------
 --- various
 
 -----------------------------------------------------------------------------
 --- various
@@ -112,9 +112,9 @@ vim.opt.wildignore = { '*.o', '*.pyc', '*.pyo', '*~', '*.bk', '*.bak' }
 vim.opt.secure = true
 
 -- list that specifies what to write in the ShaDa file
 vim.opt.secure = true
 
 -- list that specifies what to write in the ShaDa file
-vim.opt.shada = {'!', '%', '\'100', '/100', ':100', '<100', '@100', 'f1', 'h', 's10' }
+vim.opt.shada = { "!", "%", "'100", "/100", ":100", "<100", "@100", "f1", "h", "s10" }
 -- location of shada file
 vim.opt.shadafile = vim.g.statedir .. "shada/main.shada"
 
 -- disable the mouse entirely
 -- location of shada file
 vim.opt.shadafile = vim.g.statedir .. "shada/main.shada"
 
 -- disable the mouse entirely
-vim.opt.mouse = ''
+vim.opt.mouse = ""
index d5d9387c94fd95f9dd711fb5ed0283ed2b4d221a..fba3a5841c60538efb75416429031ed8e06155be 100644 (file)
@@ -4,8 +4,11 @@
 !/.config/nvim/init.lua
 !/.config/nvim/keymaps.lua
 !/.config/nvim/options.lua
 !/.config/nvim/init.lua
 !/.config/nvim/keymaps.lua
 !/.config/nvim/options.lua
+<<<<<<< HEAD
 !/.config/nvim/plugin/ale.lua
 !/.config/nvim/plugin/highlight-yank.lua
 !/.config/nvim/plugin/ale.lua
 !/.config/nvim/plugin/highlight-yank.lua
+=======
+>>>>>>> 27ab3a2 (Import options from vimrc)
 !/.config/nvim/plugin/listmode.lua
 !/.config/nvim/plugin/lspconfig.lua
 !/.config/nvim/plugin/vim-artesanal.lua
 !/.config/nvim/plugin/listmode.lua
 !/.config/nvim/plugin/lspconfig.lua
 !/.config/nvim/plugin/vim-artesanal.lua