Introduction
Introduction Statistics Contact Development Disclaimer Help
init.lua - dotfiles - These are my dotfiles. There are many like it, but these …
git clone git://jay.scot/dotfiles
Log
Files
Refs
README
---
init.lua (3416B)
---
1 --- bootstrap
2
3 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
4 if not vim.loop.fs_stat(lazypath) then
5 vim.fn.system({
6 "git",
7 "clone",
8 "--filter=blob:none",
9 "https://github.com/folke/lazy.nvim.git",
10 "--branch=stable",
11 lazypath,
12 })
13 end
14 vim.opt.rtp:prepend(lazypath)
15
16 --- plugins
17
18 require("lazy").setup({
19
20 -- colour theme
21 {
22 "ellisonleao/gruvbox.nvim",
23 priority = 1000,
24 config = function()
25 require("gruvbox").setup({
26 contrast = "hard",
27 })
28 vim.cmd([[colorscheme gruvbox]])
29 end,
30 },
31
32 -- status bar
33 {
34 "nvim-lualine/lualine.nvim",
35 dependencies = { "nvim-tree/nvim-web-devicons" },
36 config = function()
37 require("lualine").setup({
38 options = {
39 theme = "gruvbox",
40 icons_enabled = false,
41 },
42 sections = {
43 lualine_c = {
44 {
45 "filename",
46 file_status = tr…
47 path = 1,
48 },
49 },
50 },
51 })
52 end,
53 },
54
55 -- remove spaces at the end of lines
56 {
57 "lewis6991/spaceless.nvim",
58 config = function()
59 require("spaceless").setup()
60 end,
61 },
62
63 -- comments
64 {
65 "numToStr/Comment.nvim",
66 config = function()
67 require("Comment").setup()
68 end,
69 },
70
71 -- file fuzzy finding
72 {
73 "nvim-telescope/telescope.nvim",
74 dependencies = {
75 "nvim-lua/plenary.nvim",
76 },
77 },
78
79 -- file browser
80 {
81 "nvim-telescope/telescope-file-browser.nvim",
82 dependencies = {
83 "nvim-telescope/telescope.nvim",
84 "nvim-lua/plenary.nvim",
85 },
86 },
87
88 -- ale
89 {
90 'dense-analysis/ale',
91 config = function()
92 local g = vim.g
93
94 g.ale_ruby_rubocop_auto_correct_all = 1
95 g.ale_c_cc_options = "-ansi -pedantic -std=c89 -Wall"
96 g.ale_fixers = {
97 c = {'gcc'}
98 }
99 end
100 },
101
102 -- terraform
103 {
104 "hashivim/vim-terraform",
105 lazy = true,
106 ft = { 'terraform', 'hcl' }
107 },
108
109 })
110
111 --- settings
112
113 -- appearance
114 vim.opt.number = true
115 vim.opt.signcolumn = "yes"
116 vim.opt.colorcolumn = "72"
117 vim.opt.termguicolors = true
118
119 -- behaviour
120 vim.opt.backup = false
121 vim.opt.swapfile = false
122 vim.opt.showmatch = true
123 vim.opt.mouse = ""
124
125 -- spelling
126 vim.opt.spell = true
127 vim.opt.spelllang = "en_gb"
128 vim.opt.spelloptions = "camel"
129
130 -- search
131 vim.opt.hlsearch = true
132 vim.opt.incsearch = true
133 vim.opt.ignorecase = true
134
135 -- indent
136 vim.opt.wrap = false
137 vim.opt.tabstop = 4
138 vim.opt.expandtab = false
139 vim.opt.shiftwidth = 4
140 vim.opt.smartindent = true
141
142 -- show space and tab characters
143 vim.o.list = true
144 vim.o.listchars = "tab:› ,trail:⋅,nbsp:␣"
145
146 -- map leader to <space>
147 vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
148 vim.g.mapleader = " "
149
150 -- indenting
151 vim.keymap.set("v", "<", "<gv")
152 vim.keymap.set("v", ">", ">gv")
153
154 -- comments
155 vim.keymap.set("n", "<C-/>", "gcc", { noremap = false })
156 vim.keymap.set("v", "<C-/>", "gcc", { noremap = false })
157
158 -- open file_browser with the path of the current buffer
159 vim.keymap.set("n", "<leader>ff", ":Telescope file_browser path=%:p:h se…
160
161 -- open fuzzy find file browser
162 vim.keymap.set("n", "<leader>fg", ":Telescope find_files<CR>", { noremap…
163
164 -- open buffers list
165 vim.keymap.set("n", "<leader>fb", ":Telescope buffers<CR>", { noremap = …
166
167 -- format paragraphs
168 vim.keymap.set("n", "<leader>pp", "gqap", { noremap = true, silent = tru…
169 vim.opt.textwidth = 72
170
171 -- enable spellchecking
172 vim.keymap.set("n", "<leader>ps", ":setlocal spell! spelllang=en_gb<CR>"…
173
174 vim.g.terraform_fmt_on_save = 1
175
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.