Move various settings into dedicated files based on purpose
This commit is contained in:
parent
4cba0df0be
commit
1667293a83
45
init.lua
45
init.lua
|
@ -1,41 +1,14 @@
|
|||
vim.g.python3_host_prog = '~/.pyenv/versions/neovim3/bin/python'
|
||||
|
||||
-- Load plugins as defined for Packer
|
||||
require 'plugins'
|
||||
|
||||
-- Define custom keymappings
|
||||
require 'keymaps'
|
||||
|
||||
-- Setup LSP configuration
|
||||
require 'config_lsp'
|
||||
|
||||
vim.notify = require("notify")
|
||||
vim.cmd("colorscheme nightfox") -- TODO
|
||||
-- Set additional vim.opt variables
|
||||
require 'options'
|
||||
|
||||
vim.cmd("let &t_ut=''") -- For kitty background colour support
|
||||
vim.opt.updatetime=500
|
||||
vim.opt.mouse="nv"
|
||||
vim.opt.termguicolors=true
|
||||
|
||||
vim.opt.shiftwidth=4
|
||||
vim.opt.number=true
|
||||
vim.opt.relativenumber=true
|
||||
vim.opt.listchars = { trail = '.', tab = '>_' }
|
||||
vim.opt.list=true
|
||||
vim.opt.wrap=true
|
||||
vim.opt.linebreak=true
|
||||
vim.opt.autoread=true
|
||||
|
||||
vim.opt.expandtab=true
|
||||
vim.opt.autoindent=true
|
||||
vim.opt.smartindent=true
|
||||
|
||||
vim.opt.splitbelow=true
|
||||
vim.opt.splitright=true
|
||||
|
||||
-- TODO convert to lua
|
||||
vim.cmd[[
|
||||
au BufRead,BufNewFile *.ipynb setlocal filetype=json
|
||||
au BufRead,BufNewFile *.md setlocal spell
|
||||
au BufRead,BufNewFile *.code-workspace setlocal filetype=json
|
||||
au BufRead,BufNewFile *.csv setlocal nowrap
|
||||
au BufRead,BufNewFile *.service[a-zA-Z0-9]* setlocal filetype=systemd
|
||||
au TermOpen * setlocal nonumber norelativenumber
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
]]
|
||||
-- Remaining vim commands to be converted to lua
|
||||
require 'vimcommands'
|
||||
|
|
7
lua/config_filetypes/config_python.lua
Normal file
7
lua/config_filetypes/config_python.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
vim.g.python3_host_prog = '~/.pyenv/versions/neovim3/bin/python'
|
||||
vim.g.python_indent = {
|
||||
open_paren = 'shiftwidth()',
|
||||
nested_paren = 'shiftwidth()',
|
||||
continue = 'shiftwidth()',
|
||||
closed_paren_align_last_line = 'v:false',
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
vim.opt.termguicolors=true
|
||||
require('nightfox').setup{
|
||||
modules = {
|
||||
aerial = true,
|
||||
|
@ -12,3 +13,4 @@ require('nightfox').setup{
|
|||
treesitter = true,
|
||||
},
|
||||
}
|
||||
vim.cmd("colorscheme nightfox")
|
||||
|
|
1
lua/filetypes.lua
Normal file
1
lua/filetypes.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require 'config_filetypes.config_python'
|
15
lua/options.lua
Normal file
15
lua/options.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
vim.opt.mouse="nv"
|
||||
vim.opt.shiftwidth=4
|
||||
vim.opt.number=true
|
||||
vim.opt.relativenumber=true
|
||||
vim.opt.listchars = {trail = '.', tab = '>_'}
|
||||
vim.opt.list=true
|
||||
vim.opt.wrap=true
|
||||
vim.opt.linebreak=true
|
||||
vim.opt.autoread=true
|
||||
vim.opt.expandtab=true
|
||||
vim.opt.autoindent=true
|
||||
vim.opt.smartindent=true
|
||||
vim.opt.splitbelow=true
|
||||
vim.opt.splitright=true
|
||||
|
|
@ -7,7 +7,12 @@ vim.cmd([[
|
|||
|
||||
require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'rcarriga/nvim-notify'
|
||||
use {
|
||||
'rcarriga/nvim-notify',
|
||||
config = function ()
|
||||
vim.notify = require("notify")
|
||||
end
|
||||
}
|
||||
use 'kyazdani42/nvim-web-devicons'
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'christoomey/vim-tmux-navigator'
|
||||
|
|
12
lua/vimcommands.lua
Normal file
12
lua/vimcommands.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
-- TODO convert to lua
|
||||
vim.cmd("let &t_ut=''") -- For kitty background colour support
|
||||
vim.cmd[[
|
||||
au BufRead,BufNewFile *.ipynb setlocal filetype=json
|
||||
au BufRead,BufNewFile *.md setlocal spell
|
||||
au BufRead,BufNewFile *.code-workspace setlocal filetype=json
|
||||
au BufRead,BufNewFile *.csv setlocal nowrap
|
||||
au BufRead,BufNewFile *.service[a-zA-Z0-9]* setlocal filetype=systemd
|
||||
au TermOpen * setlocal nonumber norelativenumber
|
||||
syntax on
|
||||
]]
|
||||
|
Loading…
Reference in a new issue