1 -------------------------------------------------------------------------------
3 -------------------------------------------------------------------------------
5 vim.opt.number = true -- Show number column
6 vim.opt.wrap = false -- Don't wrap text
7 vim.opt.list = true -- Display tabs and trailing space
8 vim.opt.cursorline = true -- Highlight cursor line
9 vim.opt.colorcolumn='80,150' -- Show color columns
12 vim.opt.termguicolors = true
13 vim.cmd.color('tranquil')
15 -- Tab Style (Always override with editorconfig)
16 vim.opt.tabstop = 2 -- 2 Spaces per tab
17 vim.opt.shiftwidth = 2 -- Spaces used in Autoindent
18 vim.opt.softtabstop = 2 -- Spaces used when soft tabbing
19 vim.opt.expandtab = true -- Always use spaces
21 -------------------------------------------------------------------------------
23 -------------------------------------------------------------------------------
25 vim.opt.ignorecase = true -- Ignore case when searching
26 vim.opt.smartcase = true -- Unless we use both cases in search
28 -- Autocomplete Behavior
29 vim.opt.wildmode = 'list:longest,list:full' -- Autocomplete common matching string
32 vim.opt.foldmethod = 'syntax' -- Use syntax highlight to define folds
33 vim.opt.foldnestmax = 10 -- Max 10 folds
34 vim.opt.foldlevelstart = 99 -- Start with all folds open
36 -- Relative Number Behavior
37 vim.api.nvim_create_autocmd({'FocusLost', 'InsertEnter'}, {
39 callback = function () vim.opt.relativenumber = false end,
41 vim.api.nvim_create_autocmd({'InsertLeave', 'CursorMoved'}, {
43 callback = function () vim.opt.relativenumber = true end,
46 vim.keymap.set('n', '<C-n>', function()
47 vim.opt.relativenumber = not vim.opt.relativenumber
50 -- Move lines / blocks up and down using Ctrl + Shift
51 vim.keymap.set('n', '<C-S-j>', ':m .+1<CR>==')
52 vim.keymap.set('n', '<C-S-k>', ':m .-2<CR>==')
53 vim.keymap.set('i', '<C-S-j>', '<Esc>:m .+1<CR>==gi')
54 vim.keymap.set('i', '<C-S-k>', '<Esc>:m .-2<CR>==gi')
55 vim.keymap.set('v', '<C-S-j>', ':m \'>+1<CR>gv=gv')
56 vim.keymap.set('v', '<C-S-k>', ':m \'<-2<CR>gv=gv')
58 -- Navigate the location list
59 vim.keymap.set('n', '<M-j>', ':lnext<CR>')
60 vim.keymap.set('n', '<M-k>', ':lprev<CR>')
61 vim.keymap.set('n', '<M-S-j>', ':cnext<CR>')
62 vim.keymap.set('n', '<M-S-k>', ':cprev<CR>')
64 -------------------------------------------------------------------------------
65 -- File Specific Behavior
66 -------------------------------------------------------------------------------
68 vim.api.nvim_create_autocmd({'FileType'}, {
70 callback = function () vim.opt.expandtab = false end
74 vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
75 pattern = {'*.asm', '*.s'},
76 callback = function () vim.opt.filetype = 'snes' end
79 vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
81 callback = function () vim.opt.filetype = 'markdown' end
84 -------------------------------------------------------------------------------
86 -------------------------------------------------------------------------------
87 pcall(require, 'init_local')
89 -------------------------------------------------------------------------------
90 -- Plugin Specific Behavior
91 -------------------------------------------------------------------------------
93 vim.keymap.set('n', '<c-P>',
94 "<cmd>lua require('fzf-lua').files({ fzf_opts = {} })<CR>", { silent = true })
97 vim.api.nvim_set_keymap('n', '<leader>n', ':ASToggle<CR>', {})
100 vim.g.vim_svelte_plugin_use_typescript = true
103 vim.g.coq_settings = {
104 auto_start = 'shut-up',
113 vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
116 vim.keymap.set('n', '<leader>U', vim.cmd.UndotreeToggle)
120 require('treesitter_config')
122 require('dap_config')
123 require('calendar_tools')