all repos — dotfiles @ ef4e054f609a65e639255b16addda1c1ad656ec4

my *nix dotfiles

nvim: switch to neovim 0.7.0 features
Anirudh Oppiliappan x@icyphox.sh
Sat, 16 Apr 2022 20:30:05 +0530
commit

ef4e054f609a65e639255b16addda1c1ad656ec4

parent

c4037106d723b0b3e78fc94a18c824197058a5e0

M config/nvim/_init.luaconfig/nvim/_init.lua

@@ -1,5 +1,6 @@

--- impatient.nvim --- TODO: remove this once it's merged +-- loaded by home-manager; see: nix/programs/neovim.nix + +-- TODO: ref: https://github.com/neovim/neovim/pull/15436 require 'impatient' require 'settings'
M config/nvim/lua/maps.luaconfig/nvim/lua/maps.lua

@@ -1,5 +1,5 @@

local cmd = vim.cmd -local map = vim.api.nvim_set_keymap +local map = vim.keymap.set local u = require 'utils' local M = {}

@@ -8,7 +8,7 @@ map('n', '<Space>', '', {})

vim.g.mapleader = ' ' -local options = { noremap = true, silent = true } +local options = { silent = true } map('n', '<leader><esc>', ':nohlsearch<cr>', options) map('n', '<leader>n', ':bnext<cr>', options) map('n', '<leader>p', ':bprev<cr>', options)

@@ -89,18 +89,12 @@ buf_set_keymap('n', 'ff', '<cmd>lua vim.lsp.buf.range_formatting()<CR>', options)

end end -vim.api.nvim_exec([[ -" Use <Tab> and <S-Tab> to navigate through popup menu -inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" -inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" - -" Set completeopt to have a better completion experience -set completeopt=menuone,noinsert,noselect - -" Avoid showing message extra message when using completion -set shortmess+=c - -]], false) +-- vim.api.nvim_exec([[ +-- " Use <Tab> and <S-Tab> to navigate through popup menu +-- inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" +-- inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" +-- +-- ]], false) -- abbreviations local star = '★'
M config/nvim/lua/settings.luaconfig/nvim/lua/settings.lua

@@ -1,6 +1,7 @@

local u = require('utils') local o = vim.opt +local autocmd = vim.api.nvim_create_autocmd local g = vim.g local cmd = vim.cmd

@@ -28,6 +29,7 @@ o.showmode = true

o.listchars='tab:│ ,nbsp:␣,trail:·,extends:>,precedes:<' o.hidden = true o.completeopt = { 'menuone', 'noselect', 'noinsert' } +o.formatoptions:append('c') o.signcolumn = 'yes:2' o.wildignore = [[ .git,.hg,.svn

@@ -42,11 +44,15 @@ *.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb

*.swp,.lock,.DS_Store,._* ]] -vim.cmd("syntax on") --- i couldn't figure out how to set the colorscheme in lua -vim.cmd('colorscheme plain') +cmd('syntax on') +cmd('colorscheme plain') +autocmd('TextYankPost', { + pattern = '*', + callback = function() + vim.highlight.on_yank{timeout=200} + end, +}) -vim.cmd('au TextYankPost * lua vim.highlight.on_yank{timeout=200}') o.background = 'light' -- gitgutter options

@@ -69,17 +75,28 @@ -- set statusline

stl = require('statusline.line') o.statusline = '%!luaeval("stl.statusline()")' --- augroups don't have an interface yet -u.create_augroup({ - { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' }, - { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' }, -}, 'ftmail') +-- u.create_augroup({ +-- { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' }, +-- { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' }, +-- }, 'ftmail') -- restore cursor -cmd([[ au BufReadPost * call setpos(".", getpos("'\"")) ]]) +autocmd('BufReadPost', { + pattern = '*', + callback = function() + vim.fn.setpos(".", vim.fn.getpos("'\"")) + end, +}) -- unknown files are 'text' -cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif') +autocmd('BufNewFile,BufRead', { + pattern = '*', + callback = function() + if vim.bo.filetype == "" then + vim.bo.filetype = 'text' + end + end, +}) -- coq.nvim g.coq_settings = {

@@ -95,7 +112,8 @@ },

} -- filetype.nvim -g.did_load_filetypes = 1 +g.do_filetype_lua = 1 +g.did_load_filetypes = 0 -- disable built-in plugins local disabled_built_ins = {

@@ -105,9 +123,8 @@ 'tarPlugin',

'tar', 'zipPlugin', 'zip', - 'netrwPlugin', } -for i = 1, 7 do +for i = 1, 6 do g['loaded_' .. disabled_built_ins[i]] = 1 end
M nix/flake.locknix/flake.lock

@@ -102,15 +102,15 @@ "neovim-flake": "neovim-flake",

"nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1649837914, - "narHash": "sha256-wSkJqBOVXgqBl6c/8v80Z5cVw8ODN0gt5TB1apdQnI0=", - "owner": "nix-community", + "lastModified": 1650080058, + "narHash": "sha256-mSnDYhZCnw13vApIApeZMIYvuYnrd+Bal4aWbD3xzOc=", + "owner": "icyphox", "repo": "neovim-nightly-overlay", - "rev": "12d8c6b785d578379d178d3102a7ccfcf7335f47", + "rev": "f1a9f57e86962cf01b442cf831d0c9c76c4382da", "type": "github" }, "original": { - "owner": "nix-community", + "owner": "icyphox", "repo": "neovim-nightly-overlay", "type": "github" }

@@ -125,11 +125,11 @@ ]

}, "locked": { "dir": "contrib", - "lastModified": 1649798963, - "narHash": "sha256-bO271rs7X8n3BH/wfX+EsRuanfrT1AY5M3eg6XcUgvI=", + "lastModified": 1650074328, + "narHash": "sha256-CzcPEg3uUuyiVNAAw7u30pQBAYuR6a7YVo+7GhQ5BpI=", "owner": "neovim", "repo": "neovim", - "rev": "18152cf6f17fb4fd6dc6194bad33a971fc985b75", + "rev": "3f2e9298bdd971a4d2baa298aff7c6f2c2c1ad1a", "type": "github" }, "original": {

@@ -156,11 +156,11 @@ }

}, "nixpkgs": { "locked": { - "lastModified": 1649673231, - "narHash": "sha256-1T3AFscfS7s9pkFA+UIDrHH3/RLVjRdYs5ImuLYpOlE=", + "lastModified": 1649986882, + "narHash": "sha256-cNsInUFq1MbuvaEmv8x6jetWnmAU+osMpnwKumtjksI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "33772708c6d0e33f697426ba386aa0149cbcbecb", + "rev": "5181d5945eda382ff6a9ca3e072ed6ea9b547fee", "type": "github" }, "original": {
M nix/flake.nixnix/flake.nix

@@ -11,7 +11,7 @@ url = "github:nix-community/home-manager/release-21.11";

inputs.nixpkgs.follows = "nixpkgs"; }; - neovim.url = "github:nix-community/neovim-nightly-overlay"; + neovim.url = "github:icyphox/neovim-nightly-overlay"; prompt = { url = "git+https://git.peppe.rs/cli/prompt";