Skip to main content

⚙️ Configuration

FtVim is designed to be easily customizable. Your personal configuration lives in the starter template, separate from FtVim's core plugins.

📂 File Structure​

~/.config/nvim/
├── init.lua # Entry point (don't modify)
└── lua/
├── config/
│ ├── lazy.lua # Plugin manager setup & extras
│ ├── options.lua # Your Neovim options
│ ├── keymaps.lua # Your custom keymaps
│ └── autocmds.lua # Your autocommands
└── plugins/
└── example.lua # Your custom plugins

🔧 Customizing Options​

Edit ~/.config/nvim/lua/config/options.lua to override FtVim's default options:

-- Disable relative line numbers
vim.opt.relativenumber = false

-- Enable format on save (or toggle it with <leader>uf)
vim.g.ftvim_autoformat = true

-- Change leader key (default is space)
vim.g.mapleader = ","

-- Set tab width
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2

Default Options​

FtVim sets sensible defaults including:

OptionDefaultDescription
mapleader" " (space)Leader key for custom mappings
numbertrueShow line numbers
relativenumbertrueShow relative line numbers
tabstop4Tab width
shiftwidth4Indent width
expandtabfalseUse tabs (not spaces)
clipboardunnamedplusUse system clipboard
termguicolorstrueEnable 24-bit colors
mouse"a"Enable mouse support

Run :checkhealth ftvim to check that the tools FtVim needs are installed.

⌨️ Custom Keymaps​

Add your own keymaps in ~/.config/nvim/lua/config/keymaps.lua:

local map = vim.keymap.set

-- Save with Ctrl+S (already included by default)
map({ "n", "i", "v" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })

-- Close buffer with leader+c
map("n", "<leader>c", "<cmd>bd<cr>", { desc = "Close buffer" })

-- Your custom mappings here

See Keymaps for a full list of default keymaps.

🔌 Adding Plugins​

Add your plugins in ~/.config/nvim/lua/plugins/. Each .lua file in this directory is automatically loaded.

Adding a New Plugin​

Create a new file or edit example.lua:

return {
-- Add a new plugin
{
"folke/zen-mode.nvim",
cmd = "ZenMode",
keys = {
{ "<leader>z", "<cmd>ZenMode<cr>", desc = "Zen Mode" },
},
opts = {},
},
}

Overriding FtVim Plugin Settings​

You can override any plugin's settings by specifying the same plugin:

return {
-- Override neo-tree settings
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
filesystem = {
filtered_items = {
visible = false, -- Hide dotfiles
hide_dotfiles = true,
},
},
},
},
}

Disabling a Plugin​

return {
-- Disable a plugin
{ "akinsho/bufferline.nvim", enabled = false },
}

🎨 Changing Colorscheme​

See Colorscheme for detailed instructions on customizing colors.

Quick example:

-- In lua/plugins/colorscheme.lua
return {
-- Add your preferred colorscheme
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme("tokyonight")
end,
},
}

🧰 FtVim Options​

FtVim itself is configured with the opts of its spec in ~/.config/nvim/lua/config/lazy.lua:

{
"FtVim/FtVim",
import = "ftvim.plugins",
opts = {
colorscheme = "tokyonight", -- string or function
defaults = {
options = true, -- set to false to skip FtVim's options
keymaps = true, -- set to false to skip FtVim's keymaps
autocmds = true, -- set to false to skip FtVim's autocommands
},
},
},

Your lua/config/options.lua, keymaps.lua and autocmds.lua are always loaded, even when FtVim's defaults are disabled.

🚀 Enabling Extras​

FtVim includes optional features called "extras". The easiest way to enable them is :FtVimExtras (or <leader>Fx). You can also import them in ~/.config/nvim/lua/config/lazy.lua:

require("lazy").setup({
spec = {
{ "FtVim/FtVim", import = "ftvim.plugins" },

-- Enable 42 School support
{ import = "ftvim.plugins.extras.lang.42" },

-- Enable GitHub Copilot
{ import = "ftvim.plugins.extras.copilot" },

{ import = "plugins" },
},
})

See Extras for available extras and their features.