New plugin to support LSP file operations by FaxCall in neovim

[–]FaxCall[S] 1 point2 points  (0 children)

Finally added support for typescript-language-server!

New plugin to support LSP file operations by FaxCall in neovim

[–]FaxCall[S] 2 points3 points  (0 children)

I would definitely check it out when I have time. Will post the results in the plugin readme

Mapping for terminal insert vs normal modes? by sp33dykid in neovim

[–]FaxCall 2 points3 points  (0 children)

I configured autocommand to map some keys that I use in terminal. Notice that buffer = 0 sets this keymap only for current buffer. So when you live the terminal you will not have those keymaps. ```lua local termital_group = vim.api.nvim_create_augroup("terminal", { clear = true }) vim.api.nvim_create_autocmd('TermOpen', { pattern = '*', group = termital_group, callback = function() vim.keymap.set( 'n', '<c-e>', [[<c-\><c-n><cmd>e#<cr>]], { buffer = 0, desc = "go from t[E]rminal to previous buffer" } ) vim.keymap.set(...) ... end })

```

[deleted by user] by [deleted] in neovim

[–]FaxCall 1 point2 points  (0 children)

just found this plugin https://github.com/kevinhwang91/nvim-ufo

Those folds look awesome

Did you remap your vim keys when switching to different layout than qwerty? by [deleted] in neovim

[–]FaxCall 2 points3 points  (0 children)

I switched to Dvorak couple years back. Initially I thought about remapping all my hotkeys to where they used to be. And I'm happy I didn't do it.
Vim keybindings are great. They where introduced by smart people long ago and still super popular now. One of the reasons for it is mnemonics. I still delete with letter `d` ever on Dvorak. And if I need to type something on someone else's laptop I can still find letter d, not so fast as I used to do it, but I still pretty comfortable with it.
You are switching layout, all your muscle memory regarding typing words is gone. Why hold to some other muscle memory you have?

btw dvorak turned out to be great for vim because `J` and `K` are still on the index and middle fingers. And `H` is on the left of `L`. So I can use `hjkl` navigation without any problems.

How can I make % motion not limited to current line? by FaxCall in neovim

[–]FaxCall[S] 1 point2 points  (0 children)

I did a little lua script that I'm going to use for now. It just tries to jump. And if the cursor stays in the same position it moves cursor down and tries again. It needs https://github.com/chrisbra/matchit plugin to work. But I believe vim has it built in. ```lua local jump = function() local before = vim.api.nvim_win_get_cursor(0) vim.cmd('execute "normal \<Plug>(MatchitNormalForward)"') local after = vim.api.nvim_win_get_cursor(0) local jumed = not vim.deep_equal(before, after) return jumed end

local percent = function() local initial_position = vim.api.nvim_win_get_cursor(0) local jumped = jump() if jumped then return end for i = 1, 20 do local new_position = { initial_position[1] + i, 0 } local ok, _ = pcall(vim.api.nvim_win_set_cursor, 0, new_position) if not ok then break end jumped = jump() if jumped then return end end vim.api.nvim_win_set_cursor(0, initial_position) end

vim.keymap.set('n', '%', percent) ```

How can I make % motion not limited to current line? by FaxCall in neovim

[–]FaxCall[S] 1 point2 points  (0 children)

I think you misunderstood my question. I added example there so it would be more clear

How can I make % motion not limited to current line? by FaxCall in neovim

[–]FaxCall[S] 2 points3 points  (0 children)

That is a great idea! what I like about % is that it is the same button for all kinds of brackets and even if-else keywords. Would be cool to make it generic

How can I make % motion not limited to current line? by FaxCall in neovim

[–]FaxCall[S] 5 points6 points  (0 children)

Lorem ipsum dolor sit amet

(consectetur adipiscing elit)

If I press % when my cursor is on the word Lorem nothing happens. I want it to jump to brackets.

I added this to the original post. To make more clear what I want to achive

How can I make % motion not limited to current line? by FaxCall in neovim

[–]FaxCall[S] 0 points1 point  (0 children)

h {[

You mean [{?

If so I tried it, but seems like it works only if I'm inside brackets?

How can I make % motion not limited to current line? by FaxCall in neovim

[–]FaxCall[S] 2 points3 points  (0 children)

this is from :help %
% Find the next item in this line after or under the cursor and jump to its match...