Commit Graph
100 Commits
Author SHA1 Message Date
jdhao c7fb090e4c update README 2024-12-22 14:04:56 +01:00
jdhao a02f317a1d update supported nvim version to v0.10.3 2024-12-22 13:56:41 +01:00
jdhao f95d4c09b4 disable mouse 2024-12-21 00:03:38 +01:00
jdhao 7e706515a8 silently format lua file using stylua
We need to disable the mapping set for LSP, otherwise the mapping set in
lua.vim will be overridden.
2024-12-19 23:45:15 +01:00
jdhao 1d66475cae make option showcmd shown in statusline instead
Related issues:

+ https://groups.google.com/g/vim_dev/c/YwFLUaduXTQ
+ https://github.com/neovim/neovim/pull/21202
+ https://github.com/nvim-lualine/lualine.nvim/issues/949
2024-12-19 23:39:14 +01:00
jdhao 5328c477a8 reformat with stylua 2024-12-19 22:16:23 +01:00
jdhao 917ab82ffb update dict 2024-12-19 22:13:53 +01:00
jdhao 54eb3ca811 install new plugins 2024-12-19 22:08:56 +01:00
jdhao 64b41fbd58 use native lua api instead of vim.cmd 2024-12-19 22:01:04 +01:00
jdhao d941be482b update lualine config 2024-12-08 21:34:47 +01:00
jdhao ab75189231 Fix command CopyPath issue
the string.gsub in lua is not flexible and use vim.fn.substitute()
instead.
2024-11-29 23:25:19 +01:00
jdhao 7645751dc1 Update readme 2024-11-27 00:05:38 +01:00
jdhao 8880268140 custom command update
1. Add new command `CopyPath`
2. Revise command `JSONFormat`: implemented using the nvim lua interface
   and fix a few issues. The previous implementation is removed.
2024-11-27 00:05:38 +01:00
jdhao d86f599483 update the fold level allowed for statuscol.nvim 2024-11-08 22:57:33 +01:00
jdhao 8dfae271d0 use plaintext for pyright hover request
see my comment here for the details: https://www.reddit.com/r/neovim/comments/1gdv1rc/comment/lvt9nlm/
2024-11-07 21:53:32 +01:00
jdhao 1141a18c5f update config for pyright 2024-11-06 23:19:55 +01:00
jdhao fe3d5e5922 remove plugin committia.vim 2024-11-05 22:16:54 +01:00
jdhao 9769c24633 Switch Python LSP for completion and add ruff
pyright servers type checking, completion, and ruff servers linting and
diagnostics (ruff can also format Python files, but it is slightly
different from black)
2024-11-05 22:09:33 +01:00
jdhao 97f72936ac Enable LSP format also for visual selection 2024-11-05 22:04:49 +01:00
jdhao 94cade03be enable inlayhint for lua_ls server
The client side inlayhint can be enabled by uncommentting the code in
this PR.
2024-11-05 22:01:23 +01:00
jdhao 590bd6c7e6 use stylua to format lua files 2024-11-05 21:56:18 +01:00
jdhao 4171f190f2 Add plugin nvim-lightbulb to hint code actions 2024-11-05 21:47:34 +01:00
jdhao 5426c88a90 update Leaderf setting
Only search file content and not file name when using Leaderf rg
2024-11-05 21:44:34 +01:00
jdhao d715ce8f31 update supported nvim version to 0.10.2 2024-10-09 18:00:15 +02:00
jdhao 3040fa7969 use a cmp-fork for now
Until cmp is maintained again or switch??
2024-10-09 17:37:21 +02:00
jdhao b9cf3cc6ed update conf for plugin live-command.nvim 2024-09-20 21:26:28 +02:00
jdhao 154cde3d71 Add plugin live-command.nvim 2024-09-19 22:07:03 +02:00
jdhao 81f64ed32e Use absolute path for viml config
Full path should be used to load viml config, otherwise, when we open
nvim in other directories, we see errors that the viml config can not be
found.
2024-09-02 22:19:52 +02:00
jdhao db380ca7a7 remove inspect() from lua _G table
Nvim nows provides `vim.inspect()` and `vim.print()`.
2024-09-01 21:47:21 +02:00
jdhao 51f81093da restructure init.lua 2024-08-31 21:25:18 +02:00
jdhao a9fc298063 update documentation for resuming cursor position 2024-08-30 01:03:13 +02:00
jdhao 9071e045eb Make * and # search case aware
By default, when you press `*` to search word under the cursor, the
option `smartcase` is ignored. This means that if you press `*` when
your cursor is on `The`, the lower case one `the` is also searched.

In this commit, we translate star and # search into normal search so that
'smartcase' option is respected.
2024-08-30 01:01:04 +02:00
jdhao fa79647a63 Fix type for option relativenumber
"relativenumber" should be window local option, not buffer local option.
2024-08-29 21:45:07 +02:00
jdhao 4b4ff5f549 Add error handling for resuming the cursor
This will close issue #328.
2024-08-29 21:41:13 +02:00
jdhao 12b0ff02b6 Move autocmd in viml to Lua 2024-08-27 23:12:33 +02:00
jdhao e3930e8aa7 remove unused plugins 2024-08-25 23:36:29 +02:00
jdhao 21522bd194 update config for yanky 2024-08-25 23:34:03 +02:00
jdhao a3c8b3d5b5 Update configuration for nvim-cmp
1. restrict max width of the completion menu. Here I am using
   lspkind.nvim to achieve this. There are other native ways to do this,
   see also https://github.com/hrsh7th/nvim-cmp/discussions/609 and
   https://github.com/hrsh7th/nvim-cmp/issues/980
2. remove cmp-emoji as it is rarely used and interfere when I write
   Python
3. lower the transparency for popup menu
2024-08-20 01:04:02 +02:00
jdhao d150f39afc Add new plugins 2024-08-19 23:37:57 +02:00
jdhao 3904cd4ccf Update config for handling large files 2024-08-19 23:34:21 +02:00
jdhao 95d3b2f2d8 remove setting for JSON file 2024-08-19 22:36:58 +02:00
jdhao c3d8dc3e1d Add mapping to delete other buffers 2024-08-17 17:33:36 +02:00
jdhao f9780c2dff update config for bufferline.nvim
Do not show buffer number and use a mapping to pick buffer instead.
2024-08-17 17:29:33 +02:00
jdhao 256c37a946 update vim-fugitive mapping 2024-08-17 15:16:08 +02:00
jdhao eff98d036d update README 2024-08-17 15:10:33 +02:00
jdhao 6e60475f3f Use gx.nvim for browsing in Browser 2024-08-16 00:03:43 +02:00
jdhao d90273df8e remove lua_ls conf in favor of lazydev.nvim
The removed settings are already set by lazydev.nvim.
2024-08-15 23:44:50 +02:00
jdhao 659f410b9e move version check into function 2024-08-15 23:38:31 +02:00
jdhao a602d98819 fix git mapping issue
`<cmd> `mapping must end with `<CR>`
2024-08-09 22:23:04 +02:00
jdhao 9ff76931e3 update git related mappings 2024-08-09 22:19:13 +02:00
jdhao 85232b82a8 Update mapping of plugin open-browser.vim 2024-08-09 22:05:54 +02:00
jdhao cfc0089bb5 add plugin lazydev.nvim 2024-08-07 00:48:21 +08:00
jdhao f1062a3d8f filter fold level sign for statuscol.nvim
Only show fold signs for fold level below a certain level to avoid
clutter the left side columns with a lot of folding signs
2024-08-07 00:14:19 +08:00
jdhao fd6df981cd Update nvim-ufo settings 2024-08-06 23:58:54 +08:00
jdhao 8af8ebd72a remove statusline.lua 2024-08-06 17:25:33 +02:00
jdhao 4c697d89f3 change name of lualine config 2024-08-06 23:04:37 +08:00
jdhao e6f95cedb1 Update installation doc 2024-08-06 06:51:39 +08:00
jdhao 262ad6aa38 Add new colorscheme kanagawa 2024-08-06 06:16:07 +08:00
jdhao b30cc9ed78 update user dictionary 2024-08-06 06:05:20 +08:00
jdhao b3a26e4226 update load condtion for nvim-tree 2024-08-06 06:02:02 +08:00
jdhao 794b098090 Add git blame mapping 2024-08-06 05:59:14 +08:00
jdhao b728b39784 update type hint for functions 2024-08-06 05:35:19 +08:00
jdhao acc3ed7829 show error message only when no word is under cursor 2024-08-06 05:33:24 +08:00
jdhao 44e9e5a1ce Fix lua_ls diagnostic warnings 2024-08-06 05:24:16 +08:00
jdhao 5502d29f40 update config related to folding
1. For python and lua, rely on LSP for folding
2. show fold signs on the right of the number column
2024-08-06 05:17:51 +08:00
jdhao fe95658319 Add colorscheme arctic.nvim 2024-08-05 06:25:28 +08:00
jdhao e165276763 fix error when there is no cursor word 2024-08-05 06:23:18 +08:00
jdhao 933b887281 update config for nvim-ufo 2024-08-05 05:50:45 +08:00
jdhao 69643e143a use plugin nvim-ufo for better folding
The settings are copied from https://github.com/kevinhwang91/nvim-ufo/issues/4#issuecomment-1514537245,
with some modification.
2024-08-05 05:27:49 +08:00
jdhao 7f4772fd31 update setting for colorscheme gruvbox-material 2024-08-05 05:04:35 +08:00
jdhao bf49e90947 change value for option 'splitkeep' 2024-08-05 05:03:02 +08:00
jdhao 784b435f0e update LeaderF settings 2024-08-02 23:41:36 +08:00
jdhao beec97c086 Fix firenvim and LeaderF build issues
In lazy.nvim, the `build` parameter accept value in different format.
If the value is
1. a string and starts with `:`, it will be treated as vim command
2. a string and starts without `:`, it will be treated as shell command
3. a function. Lazy.nvim will run this function

I compared closely between case 1 and case 3. In case 1, when lazy.nvim
runs the viml command, the runtimepath is already populated with the
current plugin we are trying to build.
However in case 3, the runtimepath is not populated with the plugin
path, which means that any command you run by this plugin is not
available.

So I did it in a hacky way to add the plugin path to runtimepath
manually, and source it manually using `:runtime` command. The `:
runtime` command is needed because in the init process, adding the
plugin path to runtimepath does not ensure that the script under this
plugin is sourced immediately. So if we want to use the command/function
immediately, we need to source it manually, see also https://github.com/neovim/neovim/issues/29957.
2024-08-02 23:38:16 +08:00
jdhao bbb8545403 update lualine config
- rearrange a few components
- add and remove a few components
2024-08-02 06:23:21 +08:00
jdhao 9efadac8fb update lazy.nvim config 2024-08-01 04:14:34 +08:00
jdhao 6e137fe9a3 make firenvim work again
1. fix build issue
2. fix PATH env issue
2024-07-31 07:09:50 +08:00
jdhao 719fbfc1ab update lua_ls settings 2024-07-31 05:42:33 +08:00
jdhao e815de294f update plugin for markdown preview 2024-07-27 03:25:36 +08:00
jdhao ca7430056c update to neovim version 0.10.1 2024-07-26 03:32:54 +08:00
jdhao cb8c9208e1 update which-key conf and some mappings 2024-07-25 04:00:17 +08:00
jdhao ce1e13e2c9 use plugin nvim-autopairs for autopair
delimitMate is not updated for a long time.
2024-07-14 05:17:49 +08:00
jdhao 2af616bb0d Update hop.nvim conf to support Chinese 2024-06-26 03:33:24 +08:00
jdhao 3694d3c237 Update config for GitSigns 2024-06-26 03:25:01 +08:00
jdhao 69d8543495 remove emmylua since neovim has builtin annotation
Seee also this https://github.com/neovim/neovim/pull/24493
2024-05-20 22:09:07 +02:00
jdhao be3d134c37 use vim.uv instead of vim.loop 2024-05-20 21:52:52 +02:00
jdhao 601396f700 upgrade neovim to latest stable
The way to compare versions are changed due to a bug in comparing
versions in the neovim core: https://github.com/neovim/neovim/issues/28782
2024-05-20 21:33:38 +02:00
jdhao e462ebcbcc Enable treesitter folding for Python and Lua 2024-05-08 03:46:45 +08:00
jdhao 2f8482639d update some mappings
1. fix a typo in gJ mapping when setting the mark, the correct syntax is
   `mz` (set mark `z`), not `zm`

2. fix bug with `iB` text object: previously `viB` does not work as
   expected, because it does not select the entire buffer as expected.
   After much investigation, I found it is because the `<cmd>` mapping
   argument. If we use `<cmd>` argument for mapping, the mode does not
   change. So if we use `viB`, inititally we are still in visual mode.
   Later in the implementation, when we use `` normal! `<V`>  `` to
   select the entire buffer, it interferes with original visual mode. As
   a result, the entire buffer is not selected. In the text obj
   implementation, we can use `exe "normal! \<Esc>"` to clear the visual
   mode and make `viB`, but this is not ideal. I think it is eaiser to
   just not use the `<cmd>` argument and use `:<C-U>` instead.
2024-02-28 06:36:05 +08:00
jdhao 050eacaee2 Stop showing percent location
The percent location is useless and just noise.
2024-02-23 06:11:21 +08:00
jdhao 01bc4b40d3 update used plugins 2024-02-02 03:52:26 +08:00
jdhao c06d46e84d remove lazylock
I don't use this feature at all.
2024-02-02 03:43:55 +08:00
jdhao 7cf70f31af Update colorscheme conf
1. remove some colorscheme that doesn't work well with Markdown
2. change how the colorscheme conf is organized.
2024-02-02 03:40:11 +08:00
jdhao 8416508686 Enable nvim-tree to open dir during startup
Now when you open a directory when starting nvim, nvim-tree will be
opened to handle the directory correctly, see also issue #257.
2024-01-07 15:24:47 +01:00
jdhao df9491b05b bump neovim version to 0.9.5 2024-01-07 14:45:29 +01:00
jdhao 17d2e3ab3e Deal with other variant of unix timestamp 2023-10-21 00:53:15 +02:00
jdhao 2c9948300d Add diffview.nvim for viewing diffs 2023-10-18 22:10:11 +02:00
jdhao dfaa3d97a5 update plugin spec 2023-10-12 23:26:43 +02:00
jdhao 8d74fcb75c Remove obsolete options for nvim-tree 2023-10-11 20:43:24 +02:00
jdhao b1f0ef63ef Rename vimscript conf directory 2023-10-11 20:41:25 +02:00
jdhao 54ca6d4191 update to nvim 0.9.4 2023-10-11 20:35:50 +02:00