Updated: 04 February 2026
Set the filetype of current buffer to nginx
set filetype=nginx
Query the filetype of the current buffer
set filetype?
Freelance software engineer United Kingdom
Updated: 04 February 2026
Set the filetype of current buffer to nginx
set filetype=nginx
Query the filetype of the current buffer
set filetype?
Updated: 03 November 2025
:LazyRoot show set of directories Lazy considers to be a root e.g. cwd root, lsp root, .git / lua root.<Leader>e open explorer at the root directory (see :LazyRoot).<Leader>E open explorer at the current working directory.Undo the LazyVim re-mappings of k -> gk and j -> gj
vim.keymap.del({ "n", "x" }, "k")
vim.keymap.del({ "n", "x" }, "j")
Updated: 24 September 2025
Working directory of current window
:lua print(vim.fn.getcwd(0, 0))
Get current window number
:lua print(vim.api.nvim_get_current_win())
Get current tabpage number
:lua print(vim.api.nvim_get_current_tabpage())
This might be how it works:
Also see :help tcd
Updated: 25 November 2024
Help
https://neovim.discourse.group/
https://github.com/neovim/neovim/discussions
Guide to using Lua in Nvim https://neovim.io/doc/user/lua-guide.html
~/.config/nvim/init.lua
-- Level 1 the function
function Foo() print 'bar' end
-- :lua Foo()
-- Level 2 user command using the function
vim.api.nvim_create_user_command('Foo', Foo, {})
-- :Foo
-- Level 3 function invoked by an event
vim.api.nvim_create_autocmd('TextYankPost', { callback = Foo })
-- try yanking some text
-- Level 4 map our function to a keyboard sequence
vim.keymap.set('n', 'xy', Foo)
Updated: 23 October 2025
~/.local/state/nvim/lsp.lognpm install -g intelephense but is probably installed by Mason anyway../.local/share/nvim/mason/packages/intelephense/node_modules/intelephense.git folder or a composer.json file.:LspInfoUpdated: 22 January 2026
Move the current window to a new tab page
CTRL-W T
Re-order tabs
:tabm 0 # Move tab to the first position
:tabm # Move tab to the last position
:tabm -1 # Move tab one slot to the left
:tabm +1 # Move tab one slot to the right
Updated: 21 September 2024
Per project configuration. A starting point:
:help dap.ext.vscode.load_launchjs
Updated: 30 June 2024
\v characters which follow, except a-zA-Z0-9_, have special meaning.
\V characters which follow have their literal meaning and must be preceded by \ to activate their special meaning.
Updated: 27 October 2025
The neovim kickstart project on GitHub https://github.com/nvim-lua/kickstart.nvim
My own neovim config, which is based on kickstart.nvim https://github.com/ChrisTaylorDeveloper/kickstart.nvim
Updated: 04 July 2025
Flash yanked text
autocmd("TextYankPost", {
pattern = "*",
desc = "Highlight text on yank.",
callback = function ()
vim.highlight.on_yank { higroup = "Search", timeout = 150 }
end,
})
Set syntax highlighting for /etc/hosts file
vim.api.nvim_create_autocmd('BufRead', {
pattern = '/etc/hosts',
desc = 'Set syntax highlighting for /etc/hosts file.',
callback = function()
-- Only the 'bash' filetype seems to work!
vim.opt.filetype = 'bash'
end,
})