File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,10 @@ Requirements
194
194
195
195
*:NvimTreeGenerateOnAttach*
196
196
197
- Creates and opens a new file `/tmp/ my_on_attach.lua ` containing an
198
- | nvim-tree.on_attach | function based on your | nvim-tree.view.mappings | ,
199
- | nvim-tree.remove_keymaps | as well as the defaults.
197
+ Creates and opens a new file `nvim- tree- on - attach.lua ` in | stdpath | `" cache" ` ,
198
+ usually `$XDG_CACHE_HOME /nvim` . Contains | nvim-tree.on_attach | function based
199
+ on your | nvim-tree.view.mappings | , | nvim-tree.remove_keymaps | as well as the
200
+ defaults.
200
201
See https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach
201
202
202
203
==============================================================================
@@ -1219,7 +1220,8 @@ In the event of a problem please disable the experiment and raise an issue.
1219
1220
Configuration for diagnostic logging.
1220
1221
1221
1222
*nvim-tree.log.enable*
1222
- Enable logging to a file `$XDG_CACHE_HOME /nvim/ nvim- tree.log `
1223
+ Enable logging to a file `nvim- tree.log ` in | stdpath | `" cache" ` , usually
1224
+ `$XDG_CACHE_HOME /nvim`
1223
1225
Type: `boolean ` , Default: `false`
1224
1226
1225
1227
*nvim-tree.log.truncate*
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ local api = require "nvim-tree.api"
2
2
local open_file = require " nvim-tree.actions.node.open-file"
3
3
local keymap = require " nvim-tree.keymap"
4
4
local notify = require " nvim-tree.notify"
5
+ local utils = require " nvim-tree.utils"
5
6
6
7
local M = {
7
8
-- only populated when legacy mappings active
@@ -401,7 +402,7 @@ function M.cmd_generate_on_attach()
401
402
return
402
403
end
403
404
404
- local name = " /tmp/my_on_attach .lua"
405
+ local name = utils . path_join { vim . fn . stdpath " cache " , " nvim-tree-on-attach .lua" }
405
406
local file = io.output (name )
406
407
io.write (M .on_attach_lua )
407
408
io.close (file )
You can’t perform that action at this time.
0 commit comments