73
73
74
74
function M .tab_change ()
75
75
if view .is_visible { any_tabpage = true } then
76
- local bufname = vim . api .nvim_buf_get_name (0 )
76
+ local bufname = api .nvim_buf_get_name (0 )
77
77
if bufname :match " Neogit" ~= nil or bufname :match " --graph" ~= nil then
78
78
return
79
79
end
156
156
157
157
local prev_line
158
158
function M .place_cursor_on_node ()
159
- local l = vim . api .nvim_win_get_cursor (0 )[1 ]
159
+ local l = api .nvim_win_get_cursor (0 )[1 ]
160
160
if l == prev_line then
161
161
return
162
162
end
@@ -255,27 +255,27 @@ local function manage_netrw(disable_netrw, hijack_netrw)
255
255
end
256
256
257
257
local function setup_vim_commands ()
258
- vim . api .nvim_create_user_command (" NvimTreeOpen" , function (res )
258
+ api .nvim_create_user_command (" NvimTreeOpen" , function (res )
259
259
M .open (res .args )
260
260
end , { nargs = " ?" , complete = " dir" })
261
- vim . api .nvim_create_user_command (" NvimTreeClose" , view .close , {})
262
- vim . api .nvim_create_user_command (" NvimTreeToggle" , function ()
261
+ api .nvim_create_user_command (" NvimTreeClose" , view .close , {})
262
+ api .nvim_create_user_command (" NvimTreeToggle" , function ()
263
263
M .toggle (false )
264
264
end , {})
265
- vim . api .nvim_create_user_command (" NvimTreeFocus" , M .focus , {})
266
- vim . api .nvim_create_user_command (" NvimTreeRefresh" , reloaders .reload_explorer , {})
267
- vim . api .nvim_create_user_command (" NvimTreeClipboard" , copy_paste .print_clipboard , {})
268
- vim . api .nvim_create_user_command (" NvimTreeFindFile" , function ()
265
+ api .nvim_create_user_command (" NvimTreeFocus" , M .focus , {})
266
+ api .nvim_create_user_command (" NvimTreeRefresh" , reloaders .reload_explorer , {})
267
+ api .nvim_create_user_command (" NvimTreeClipboard" , copy_paste .print_clipboard , {})
268
+ api .nvim_create_user_command (" NvimTreeFindFile" , function ()
269
269
M .find_file (true )
270
270
end , {})
271
- vim . api .nvim_create_user_command (" NvimTreeFindFileToggle" , function ()
271
+ api .nvim_create_user_command (" NvimTreeFindFileToggle" , function ()
272
272
M .toggle (true )
273
273
end , {})
274
- vim . api .nvim_create_user_command (" NvimTreeResize" , function (res )
274
+ api .nvim_create_user_command (" NvimTreeResize" , function (res )
275
275
M .resize (res .args )
276
276
end , { nargs = 1 })
277
- vim . api .nvim_create_user_command (" NvimTreeCollapse" , collapse_all .fn , {})
278
- vim . api .nvim_create_user_command (" NvimTreeCollapseKeepBuffers" , function ()
277
+ api .nvim_create_user_command (" NvimTreeCollapse" , collapse_all .fn , {})
278
+ api .nvim_create_user_command (" NvimTreeCollapseKeepBuffers" , function ()
279
279
collapse_all .fn (true )
280
280
end , {})
281
281
end
@@ -289,10 +289,10 @@ function M.change_dir(name)
289
289
end
290
290
291
291
local function setup_autocommands (opts )
292
- local augroup_id = vim . api .nvim_create_augroup (" NvimTree" , {})
292
+ local augroup_id = api .nvim_create_augroup (" NvimTree" , {})
293
293
local function create_nvim_tree_autocmd (name , custom_opts )
294
294
local default_opts = { group = augroup_id }
295
- vim . api .nvim_create_autocmd (name , vim .tbl_extend (" force" , default_opts , custom_opts ))
295
+ api .nvim_create_autocmd (name , vim .tbl_extend (" force" , default_opts , custom_opts ))
296
296
end
297
297
298
298
-- reset highlights when colorscheme is changed
0 commit comments