Last active
February 12, 2026 23:38
-
-
Save k3karthic/98d9b73090b4cdb44e6a9ae84318219f to your computer and use it in GitHub Desktop.
Rudimentary Vim Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax on | |
| set number | |
| set autoindent | |
| set tabstop=4 | |
| set shiftwidth=4 | |
| " YAML - 2 space indent, no tabs | |
| autocmd FileType yaml setlocal tabstop=2 shiftwidth=2 expandtab | |
| " Lua - 2 space indent, no tabs | |
| autocmd FileType lua setlocal tabstop=2 shiftwidth=2 expandtab | |
| " Python - 4 space indent, no tabs | |
| autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Basic settings | |
| vim.opt.syntax = 'on' | |
| vim.opt.number = true | |
| vim.opt.autoindent = true | |
| vim.opt.tabstop = 4 | |
| vim.opt.shiftwidth = 4 | |
| -- YAML - 2 space indent, no tabs | |
| vim.api.nvim_create_autocmd('FileType', { | |
| pattern = 'yaml', | |
| callback = function() | |
| vim.opt_local.tabstop = 2 | |
| vim.opt_local.shiftwidth = 2 | |
| vim.opt_local.expandtab = true | |
| end, | |
| }) | |
| -- Lua - 2 space indent, no tabs | |
| vim.api.nvim_create_autocmd('FileType', { | |
| pattern = 'lua', | |
| callback = function() | |
| vim.opt_local.tabstop = 2 | |
| vim.opt_local.shiftwidth = 2 | |
| vim.opt_local.expandtab = true | |
| end, | |
| }) | |
| -- Python - 4 space indent, no tabs | |
| vim.api.nvim_create_autocmd('FileType', { | |
| pattern = 'python', | |
| callback = function() | |
| vim.opt_local.tabstop = 4 | |
| vim.opt_local.shiftwidth = 4 | |
| vim.opt_local.expandtab = true | |
| end, | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment