]> 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>
Fri, 11 Apr 2025 18:48:29 +0000 (20:48 +0200)
.config/nvim/init.lua
.config/nvim/keymaps.lua [new file with mode: 0644]
.config/nvim/options.lua [new file with mode: 0644]
.gitignore.d/neovim

index be18f19b70af1f1fffeee04c0c205650b3f7af68..71a5b2a99889fe1f9f6e108d92e276bcc2a6d2a8 100644 (file)
@@ -1,6 +1,13 @@
-vim.opt.background = 'light'
+vim.g.statedir = vim.fn.expand("~/.local/state/nvim/")
+vim.g.mapleader = ';'
+vim.g.maplocalleader = ';'
 
 
-vim.keymap.set({'n', 'v', 'o', 'i'}, '<F2>', '<cmd>set invpaste<CR>')
+vim.g.netrw_home = vim.g.statedir .. "netrw"
+
+vim.cmd.runtime 'options.lua'
+vim.cmd.runtime 'keymaps.lua'
+
+vim.cmd 'packadd! gnupg'
 
 vim.call "plug#begin"
 
 
 vim.call "plug#begin"
 
diff --git a/.config/nvim/keymaps.lua b/.config/nvim/keymaps.lua
new file mode 100644 (file)
index 0000000..46f3cb7
--- /dev/null
@@ -0,0 +1,6 @@
+-- this isn't windows, screw the F1->help key
+vim.keymap.set({'n', 'v', 'o', 'i'}, '<F1>', '<Esc>')
+
+-- toggle paste mode with F2
+vim.keymap.set({'n', 'v', 'o', 'i'}, '<F2>', ':set invpaste<CR>')
+
diff --git a/.config/nvim/options.lua b/.config/nvim/options.lua
new file mode 100644 (file)
index 0000000..22c1c4e
--- /dev/null
@@ -0,0 +1,114 @@
+-----------------------------------------------------------------------------
+--- moving around, searching and patterns
+-----------------------------------------------------------------------------
+
+-- ignore case when using a search pattern
+vim.opt.ignorecase = true
+
+-- override 'ignorecase' when pattern has upper case characters
+vim.opt.smartcase = true
+
+-----------------------------------------------------------------------------
+--- syntax, highlighting and spelling
+-----------------------------------------------------------------------------
+
+-- "dark" or "light"; the background color brightness
+vim.opt.background = 'light'
+
+-----------------------------------------------------------------------------
+--- messages and info
+-----------------------------------------------------------------------------
+
+-- list of flags to make messages shorter
+vim.opt.shortmess = 'atTWoOI'
+
+-----------------------------------------------------------------------------
+--- displaying text
+-----------------------------------------------------------------------------
+
+-- preserve indentation in wrapped text
+vim.opt.breakindent = true
+
+-----------------------------------------------------------------------------
+--- editing text
+-----------------------------------------------------------------------------
+
+-- line length above which to break a line
+vim.opt.textwidth = 78
+
+-- list of flags that tell how automatic formatting works
+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
+vim.opt.completeopt = { 'menu', 'noinsert', 'popup', 'preview' }
+
+-- number of spaces used for each step of (auto)indent
+vim.opt.shiftwidth = 2
+
+-- round to 'shiftwidth' for "<<" and ">>"
+vim.opt.shiftround = true
+
+-- expand <Tab> to spaces in Insert mode
+vim.opt.expandtab = true
+
+-- copy whitespace for indenting from previous line
+vim.opt.copyindent = true
+
+-- preserve kind of whitespace when changing indent
+vim.opt.preserveindent = true
+
+-- automatically save and restore undo history
+vim.opt.undofile = true
+
+-----------------------------------------------------------------------------
+--- folding
+-----------------------------------------------------------------------------
+
+-- folding type: "manual", "indent", "expr", "marker", "syntax" or "diff"
+vim.opt.foldmethod = 'marker'
+
+-----------------------------------------------------------------------------
+--- reading and writing files
+-----------------------------------------------------------------------------
+
+-- automatically write a file when leaving a modified buffer
+vim.opt.autowrite = true
+
+-- as 'autowrite', but works with more commands
+vim.opt.autowriteall = true
+
+-- automatically read a file when it was modified outside of Vim
+vim.opt.autoread = true
+
+-----------------------------------------------------------------------------
+--- the swap file
+-----------------------------------------------------------------------------
+
+-- list of directories for the swap file
+vim.opt.directory = { '.', vim.g.statedir .. '/swap//', '/var/tmp//', '$TMPDIR//', '/tmp//' }
+
+-----------------------------------------------------------------------------
+--- command line editing
+-----------------------------------------------------------------------------
+
+-- list of patterns to ignore files for file name completion
+vim.opt.wildignore = { '*.o', '*.pyc', '*.pyo', '*~', '*.bk', '*.bak' }
+
+-----------------------------------------------------------------------------
+--- various
+-----------------------------------------------------------------------------
+
+-- safer working with script files in the current directory
+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' }
+-- location of shada file
+vim.opt.shadafile = vim.g.statedir .. "shada/main.shada"
+
+-- disable the mouse entirely
+vim.opt.mouse = ''
index b07238f7cac8851b478783eeb53d717698e988c0..caf182c304222ad6402373547f07dac50a136c2c 100644 (file)
@@ -1,6 +1,8 @@
 *
 !/.config/nvim/autoload/plug.vim
 !/.config/nvim/init.lua
 *
 !/.config/nvim/autoload/plug.vim
 !/.config/nvim/init.lua
+!/.config/nvim/keymaps.lua
+!/.config/nvim/options.lua
 !/.config/nvim/plugin/listmode.lua
 !/.config/nvim/plugin/vim-artesanal.lua
 !/.gitignore.d/neovim
 !/.config/nvim/plugin/listmode.lua
 !/.config/nvim/plugin/vim-artesanal.lua
 !/.gitignore.d/neovim