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.colorcolumn='80,150' -- Show color columns
11 vim.opt.termguicolors = true
14 -- Tab Style (Always override with editorconfig)
15 vim.opt.tabstop = 2 -- 2 Spaces per tab
16 vim.opt.shiftwidth = 2 -- Spaces used in Autoindent
17 vim.opt.softtabstop = 2 -- Spaces used when soft tabbing
18 vim.opt.expandtab = true -- Always use spaces
20 -------------------------------------------------------------------------------
22 -------------------------------------------------------------------------------
24 vim.opt.ignorecase = true -- Ignore case when searching
25 vim.opt.smartcase = true -- Unless we use both cases in search
27 -- Autocomplete Behavior
28 vim.opt.wildmode = 'list:longest,list:full' -- Autocomplete common matching string
29 -- first, and then the full match.
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 -------------------------------------------------------------------------------
59 -- File Specific Behavior
60 -------------------------------------------------------------------------------
62 vim.api.nvim_create_autocmd({'FileType'}, {
64 callback = function () vim.opt.expandtab = false end
68 vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
69 pattern = {'*.asm', '*.s'},
70 callback = function () vim.opt.filetype = 'snes' end
73 -------------------------------------------------------------------------------
75 -------------------------------------------------------------------------------
76 pcall(require, 'init_local')
78 -------------------------------------------------------------------------------
79 -- Plugin Specific Behavior
80 -------------------------------------------------------------------------------
82 vim.keymap.set('', '<C-P>', ':FZF <CR>')
83 vim.g.fzf_layout = { down = '40%' }
85 fg = {'fg', 'Normal'},
86 bg = {'bg', 'Normal'},
87 hl = {'fg', 'Comment'},
88 ['fg+'] = {'fg', 'CursorLine', 'CursorColumn', 'Normal'},
89 ['bg+'] = {'bg', 'CursorLine', 'CursorColumn'},
90 ['hl+'] = {'fg', 'Statement'},
91 info = {'fg', 'PreProc'},
92 border = {'fg', 'Ignore'},
93 prompt = {'fg', 'Conditional'},
94 pointer = {'fg', 'Exception'},
95 marker = {'fg', 'Keyword'},
96 spinner = {'fg', 'Label'},
97 header = {'fg', 'Comment'}
102 vim.g.vim_svelte_plugin_use_typescript = true
104 -- Limelight / Goyo config
106 vim.g.limelight_conceal_ctermfg = 'gray'
107 vim.g.limelight_conceal_guifg = 'DarkGray'
109 vim.api.nvim_create_autocmd({'User'}, {
110 pattern = 'GoyoEnter',
111 callback = 'Limelight'
113 vim.api.nvim_create_autocmd({'User'}, {
114 pattern = 'GoyoLeave',
115 callback = 'Limelight!'
118 nnoremap <leader>i :Limelight!!<CR>==
119 inoremap <leader>i <Esc>:Limelight!!<CR>==gi
120 vnoremap <leader>i :<C-u>Limelight!!<CR>gv=gv
121 nnoremap <leader>g :Goyo<CR>==
122 inoremap <leader>g <Esc>:Goyo<CR>==gi
123 vnoremap <leader>g :<C-u>Goyo<CR>gv=gv