Comments (17)
It uses the non-recursive :h tnoremap
instead of the :h tmap
command. Meaning that it will use internal vim mappings rather than potential user-defined mappings. I should have included that from the start.
from nnn.nvim.
Hmm, I cannot reproduce this. It should open the hovered file or the active selection if it exists.
from nnn.nvim.
Maybe the issue is somewhere else in my config:
https://github.com/Svenum/nvim-config
from nnn.nvim.
Can you make a screen recording of your problem?
from nnn.nvim.
Peek.2023-02-05.17-30.mp4
from nnn.nvim.
I have no idea what could cause this sorry. If it is splitting the window, it must mean it is executing the mapping. Could you try adding a debug print statement?
+++ b/lua/nnn.lua
@@ -422,6 +422,7 @@ end
local function open_in(files, command)
for _, file in ipairs(files) do
c(command.." "..file)
+ vim.pretty_print(command.." "..file)
end
end
from nnn.nvim.
I am added it like this in my "~/.config/nvim/autoload/plugged/nnn.nvim/lua/nnn.lua":
Where should I see the debug-code?
from nnn.nvim.
It should show up in :messages
after using a mapping.
from nnn.nvim.
But you should just add the single pretty_print()
line to the existing open_in()
function, not define a new function at the top of the file:
Lines 421 to 426 in 440ddfd
from nnn.nvim.
I got the output:
"vsplit /home/user/test/nnn-test/cloud.txt"
(vsplit first item in the list and not hovered)
from nnn.nvim.
I don't understand how it could happen, there must be something interfering. Can you try this in NnnExplorer
instead? That way you should be able to see what actually happens in the terminal window as it stays open.
from nnn.nvim.
In NnnExplorer
it is switching to the first item and then opening it in the new window.
from nnn.nvim.
If Try it a second time in NnnExplorer
it opens as it should be. Until i reopen it.
from nnn.nvim.
Is it really switching to the first item in a directory with more than two files? Or perhaps just the file above it? The mapping must be feeding either a g, or k key somehow.
from nnn.nvim.
Can you check if this fixes the issue?
+++ b/lua/nnn.lua
@@ -221,14 +221,15 @@ local function buffer_setup()
a.nvim_buf_set_option(0, opt, val)
end
+ local opts = { noremap = true }
for i, mapping in ipairs(cfg.mappings) do
- a.nvim_buf_set_keymap(0, "t", mapping[1], "<C-\\><C-n><cmd>lua require('nnn').handle_mapping("..i..")<CR>", {})
+ a.nvim_buf_set_keymap(0, "t", mapping[1], "<C-\\><C-n><cmd>lua require('nnn').handle_mapping("..i..")<CR>", opts)
end
- a.nvim_buf_set_keymap(0, "t", cfg.windownav.left, "<C-\\><C-n><C-w>h", {})
- a.nvim_buf_set_keymap(0, "t", cfg.windownav.right, "<C-\\><C-n><C-w>l", {})
- a.nvim_buf_set_keymap(0, "t", cfg.windownav.next, "<C-\\><C-n><C-w>w", {})
- a.nvim_buf_set_keymap(0, "t", cfg.windownav.prev, "<C-\\><C-n><C-w>W", {})
+ a.nvim_buf_set_keymap(0, "t", cfg.windownav.left, "<C-\\><C-n><C-w>h", opts)
+ a.nvim_buf_set_keymap(0, "t", cfg.windownav.right, "<C-\\><C-n><C-w>l", opts)
+ a.nvim_buf_set_keymap(0, "t", cfg.windownav.next, "<C-\\><C-n><C-w>w", opts)
+ a.nvim_buf_set_keymap(0, "t", cfg.windownav.prev, "<C-\\><C-n><C-w>W", opts)
end
-- Restore buffer to previous state
from nnn.nvim.
It resolved it :)
from nnn.nvim.
What does this change do?
from nnn.nvim.
Related Issues (20)
- Multiple nnn instances in various split windows (like netrw) HOT 2
- disable quitcd within neovim only HOT 5
- some quick thoughts on some implementations HOT 4
- Cannot turn off auto fullscreen of nnn window when tab is empty
- Keybind custom nnn startup command HOT 7
- preselect file when using %:p:h HOT 3
- How to make the nnn startup directory be the directory of the current file๏ผ HOT 2
- Vsplit has different size HOT 3
- Can give a highlight group for picker float window? HOT 1
- Set nnn to open if running nvim . on a directory HOT 1
- Plugins not usable within tmux session cmd override HOT 2
- barbar buffer line lists nnn buffer momentarily HOT 13
- NnnPicker doesn't show the last time of nnn HOT 5
- Opening nvim inside hidden folder makes nnn show hidden files by default HOT 2
- Enter / Return doesn't work in explorer mode but in picker mode HOT 11
- Honor the NNN_SEL env var HOT 4
- NNN preview with tmux working, but preview is still open after pressing 'enter'. HOT 1
- No possible ways to remap quit from Picker/Explorer keybind HOT 5
- NNN with tmux does not show hidden files in the preview window HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnn.nvim.