Skip to content

Commit 73a5429

Browse files
authored
Merge pull request #2 from millerjason/jason
updates 20241117
2 parents 110a406 + 18a5af5 commit 73a5429

File tree

3 files changed

+83
-20
lines changed

3 files changed

+83
-20
lines changed

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,65 @@ What is in it?
99
* *Neovimacs*: modeless editing support, with common Emacs bindings in insert mode
1010
* *Esc*: to toggle between insert (emacs bindings) and normal (neovim mode)
1111
* *Tabs*: Prev (F1), Next (F2), New (F3), and Close (F4) to jump around
12+
* *Tool Tabs*: Terminal (F5)
1213
* *Movement*: Arrows and Tabs (and, yes, I know)
1314
* *Batteries*: Python LSP, completion, treesitter
1415

1516
## 📦 Installation
1617

18+
#### Prep
19+
20+
Suggested:
21+
22+
```bash
23+
sudo apt install -y gcc python3-pip python3-venv git make unzip ripgrep gzip wget curl fd-find npm
24+
sudo npm install -g tree-sitter-cli
25+
```
26+
27+
Optional based on use-case:
28+
29+
```bash
30+
sudo apt install -y golang luarocks cargo nodejs clang python3-pynvim
31+
```
32+
33+
#### Cloning
34+
1735
```bash
1836
cd ~/.config
19-
git clone git@github.com:millerjason/neovimrc.git
37+
git clone https://github.com/millerjason/neovimrc.git
2038
ln -s neovimrc nvim
2139
```
2240

41+
#### Maint
42+
43+
```
44+
:Lazy - upgrade packages
45+
:Mason - build external tools
46+
```
47+
48+
## Life with Neovim
49+
50+
#### Do you have everything and is it working correctly?
51+
52+
Checking overall health and options:
53+
54+
```
55+
:CheckHealth
56+
:lua print(vim.inspect(vim.opt.XXXX))
57+
:set option?
58+
```
59+
60+
Beyond [which-key](https://github.com/folke/which-key.nvim), you can use the following
61+
nvim commands to help you track down key bindings and resolve conflicts:
62+
63+
```
64+
:verbose imap <C-n> -- for insert mode
65+
:verbose nmap <C-n> -- for normal mode
66+
:nmap <localleader> -- to see leader commands
67+
:WhichKey -- see above
68+
```
69+
70+
2371
### References
2472

2573
Kickstart: [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim)

init.lua

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ vim.g.mapleader = ' '
33
vim.g.maplocalleader = ' '
44
vim.g.have_nerd_font = true
55

6+
local function nvim_ver(major, minor)
7+
local version = vim.version()
8+
return (version.major > major or version.minor >= minor)
9+
end
10+
11+
-- fs_stat moves based on version :(
12+
local fs_stat = function()
13+
if nvim_ver(0, 10) then
14+
return vim.uv.fs_stat
15+
end
16+
return vim.loop.fs_stat
17+
end
18+
619
-- Margins
720
vim.opt.title = false -- in status, not great with tmux
821
vim.opt.number = true -- show line number
@@ -22,8 +35,11 @@ vim.opt.mouse = 'nvi'
2235

2336
-- File related
2437
vim.opt.autochdir = false
38+
vim.opt.swapfile = false
39+
vim.opt.backup = false
2540
vim.opt.writebackup = false
2641
vim.opt.undofile = true
42+
vim.opt.undodir = os.getenv 'HOME' .. '/.vim/undodir'
2743
if vim.fn.has 'win32' == 1 or vim.fn.has 'win64' == 1 then
2844
vim.opt.fileformats = 'dos,unix,mac'
2945
elseif vim.fn.has 'mac' == 1 then
@@ -76,7 +92,8 @@ vim.api.nvim_create_autocmd('TextYankPost', {
7692

7793
-- Install Lazy from Github
7894
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
79-
if not vim.uv.fs_stat(lazypath) then
95+
96+
if not fs_stat(lazypath) then
8097
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
8198
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
8299
if vim.v.shell_error ~= 0 then
@@ -95,6 +112,11 @@ require('lazy').setup({
95112
'millerjason/neovimacs.nvim',
96113
opts = {},
97114
},
115+
-- {
116+
-- dir = '/Users/jason/github/neovimacs.nvim',
117+
-- name = 'neovimacs.nvim',
118+
-- opts = {},
119+
-- },
98120

99121
-- Add git changes to gutter
100122
{
@@ -111,7 +133,8 @@ require('lazy').setup({
111133
},
112134

113135
-- Shows keybindings as you go
114-
{
136+
-- this technically requires >= 0.9.4
137+
unpack(nvim_ver(0, 10) and {
115138
'folke/which-key.nvim',
116139
event = 'VimEnter',
117140
config = function()
@@ -127,7 +150,7 @@ require('lazy').setup({
127150
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
128151
}
129152
end,
130-
},
153+
} or {}),
131154

132155
-- Fuzzy finder (file & lsp)
133156
-- :Telescope help_tags
@@ -643,16 +666,24 @@ local function safe_tabclose()
643666
vim.cmd 'tabclose'
644667
end
645668
end
669+
vim.keymap.set('t', '<F1>', vim.cmd.tabp, { noremap = true, silent = true })
670+
vim.keymap.set('t', '<F2>', vim.cmd.tabn, { noremap = true, silent = true })
671+
vim.keymap.set('t', '<F3>', '<C-\\><C-n>:tabnew<CR>', { noremap = true, silent = true })
672+
vim.keymap.set('t', '', '<C-\\><C-n>:tabnew<CR>', { noremap = true, silent = true })
673+
vim.keymap.set('t', '<F4>', safe_tabclose, { noremap = true, silent = true })
674+
vim.keymap.set('t', '<F5>', '<C-\\><C-n><Esc>:tab new<CR>', { noremap = true, silent = true })
646675
vim.keymap.set('n', '<F1>', vim.cmd.tabp, { noremap = true, silent = true })
647676
vim.keymap.set('n', '<F2>', vim.cmd.tabn, { noremap = true, silent = true })
648677
vim.keymap.set('n', '<F3>', ':tabnew<CR>', { noremap = true, silent = true })
649678
vim.keymap.set('n', '', ':tabnew<CR>', { noremap = true, silent = true })
650679
vim.keymap.set('n', '<F4>', safe_tabclose, { noremap = true, silent = true })
680+
vim.keymap.set('n', '<F5>', ':tab term<CR>', { noremap = true, silent = true })
651681
vim.keymap.set('i', '<F1>', vim.cmd.tabp, { noremap = true, silent = true })
652682
vim.keymap.set('i', '<F2>', vim.cmd.tabn, { noremap = true, silent = true })
653683
vim.keymap.set('i', '<F3>', '<Esc>:tabnew<CR>', { noremap = true, silent = true })
654684
vim.keymap.set('i', '', '<Esc>:tabnew<CR>', { noremap = true, silent = true })
655685
vim.keymap.set('i', '<F4>', safe_tabclose, { noremap = true, silent = true })
686+
vim.keymap.set('i', '<F5>', '<Esc>:tab term<CR>', { noremap = true, silent = true })
656687
vim.keymap.set('n', '<leader>tp', vim.cmd.tabn, { desc = 'Tab [p]revious' })
657688
vim.keymap.set('n', '<leader>tn', vim.cmd.tabp, { desc = 'Tab [n]ext' })
658689
vim.keymap.set('n', '<leader>to', vim.cmd.tabnew, { desc = 'Tab [o]pen' })

lua/kickstart/plugins/autopairs.lua

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)