]>
Commit | Line | Data |
---|---|---|
ce349909 RBR |
1 | ------------------------------------------------------------------------------- |
2 | -- Style | |
3 | ------------------------------------------------------------------------------- | |
4 | -- Editor Style | |
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 | |
9 | ||
10 | -- Color | |
11 | vim.opt.termguicolors = true | |
12 | vim.cmd.color('rbdr') | |
13 | ||
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 | |
19 | ||
20 | ------------------------------------------------------------------------------- | |
21 | -- Behavior | |
22 | ------------------------------------------------------------------------------- | |
23 | -- Search Behavior | |
24 | vim.opt.ignorecase = true -- Ignore case when searching | |
25 | vim.opt.smartcase = true -- Unless we use both cases in search | |
26 | ||
27 | -- Autocomplete Behavior | |
28 | vim.opt.wildmode = 'list:longest,list:full' -- Autocomplete common matching string | |
ce349909 RBR |
29 | |
30 | -- Folding Behavior | |
31 | vim.opt.foldmethod = 'syntax' -- Use syntax highlight to define folds | |
32 | vim.opt.foldnestmax = 10 -- Max 10 folds | |
33 | vim.opt.foldlevelstart = 99 -- Start with all folds open | |
34 | ||
35 | -- Relative Number Behavior | |
36 | vim.api.nvim_create_autocmd({'FocusLost', 'InsertEnter'}, { | |
37 | pattern = '*', | |
38 | callback = function () vim.opt.relativenumber = false end, | |
39 | }) | |
40 | vim.api.nvim_create_autocmd({'InsertLeave', 'CursorMoved'}, { | |
41 | pattern = '*', | |
42 | callback = function () vim.opt.relativenumber = true end, | |
43 | }) | |
44 | ||
45 | vim.keymap.set('n', '<C-n>', function() | |
46 | vim.opt.relativenumber = not vim.opt.relativenumber | |
47 | end) | |
48 | ||
49 | -- Move lines / blocks up and down using Ctrl + Shift | |
50 | vim.keymap.set('n', '<C-S-j>', ':m .+1<CR>==') | |
51 | vim.keymap.set('n', '<C-S-k>', ':m .-2<CR>==') | |
52 | vim.keymap.set('i', '<C-S-j>', '<Esc>:m .+1<CR>==gi') | |
53 | vim.keymap.set('i', '<C-S-k>', '<Esc>:m .-2<CR>==gi') | |
54 | vim.keymap.set('v', '<C-S-j>', ':m \'>+1<CR>gv=gv') | |
55 | vim.keymap.set('v', '<C-S-k>', ':m \'<-2<CR>gv=gv') | |
56 | ||
57 | ------------------------------------------------------------------------------- | |
58 | -- File Specific Behavior | |
59 | ------------------------------------------------------------------------------- | |
60 | -- Makefiles | |
61 | vim.api.nvim_create_autocmd({'FileType'}, { | |
62 | pattern = 'make', | |
63 | callback = function () vim.opt.expandtab = false end | |
64 | }) | |
65 | ||
66 | -- SNES files | |
67 | vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, { | |
68 | pattern = {'*.asm', '*.s'}, | |
69 | callback = function () vim.opt.filetype = 'snes' end | |
70 | }) | |
71 | ||
72 | ------------------------------------------------------------------------------- | |
73 | -- Local Overrides | |
74 | ------------------------------------------------------------------------------- | |
75 | pcall(require, 'init_local') | |
76 | ||
77 | ------------------------------------------------------------------------------- | |
78 | -- Plugin Specific Behavior | |
79 | ------------------------------------------------------------------------------- | |
80 | -- FZF | |
af913f93 RBR |
81 | vim.keymap.set("n", "<c-P>", |
82 | "<cmd>lua require('fzf-lua').files({ fzf_opts = {} })<CR>", { silent = true }) | |
ce349909 | 83 | |
7d35a7fc RBR |
84 | -- Toggle Autosave |
85 | vim.api.nvim_set_keymap('n', '<leader>n', ':ASToggle<CR>', {}) | |
86 | ||
ce349909 RBR |
87 | -- Svelte Config |
88 | vim.g.vim_svelte_plugin_use_typescript = true | |
89 | ||
fd61b7b4 | 90 | -- Coq |
2d56e8a7 RBR |
91 | vim.g.coq_settings = { |
92 | auto_start = 'shut-up', | |
93 | clients = { | |
94 | snippets = { | |
95 | warn = {} | |
96 | } | |
97 | } | |
98 | } | |
fd61b7b4 | 99 | |
ce349909 RBR |
100 | -- Plugins |
101 | require('plugins') | |
3c6ddc92 | 102 | require('treesitter_config') |
73a2d994 RBR |
103 | require('lsp') |
104 | require('dap_config') | |
7d35a7fc | 105 | require('brain') |