aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2021-12-12 12:50:50 -0700
committerCody Hiar <cody@hiar.ca>2021-12-12 12:50:50 -0700
commit98b5988b7edf0db90736fb1fa0c89dd6bf9d75a8 (patch)
tree159b7a8ced1d6d1b2646d462c65b9c2708263732
parent877dcf76cb71c84f6bd665aa8b0f3d5f7f89ddff (diff)
Updates
-rw-r--r--init.lua101
1 files changed, 21 insertions, 80 deletions
diff --git a/init.lua b/init.lua
index 811b45b..20e03d3 100644
--- a/init.lua
+++ b/init.lua
@@ -1,3 +1,4 @@
+-- Managed by Nix
-- To install everything run `:PackerSync`
-- https://dev.to/voyeg3r/writing-useful-lua-functions-to-my-neovim-14ki
@@ -31,8 +32,6 @@ function _G.print_table(mytable)
end
--- https://old.reddit.com/r/neovim/comments/lrz18i/how_to_change_colorscheme_in_lua_without_any/
-vim.g.colors_name = "nord"
-- Set up spacebar as leader
-- https://icyphox.sh/blog/nvim-lua/
vim.api.nvim_set_keymap('n', '<Space>', '', {})
@@ -72,6 +71,11 @@ for i, highlight in ipairs(highlights) do
vim.cmd('au VimEnter * hi ' .. highlight)
end
+-- Set the colorscheme
+vim.cmd [[
+colorscheme nord
+]]
+
-- Along with the highlight definition for ColorColumn above, these options
-- will set colored marks at certain line lengths
vim.cmd [[
@@ -82,7 +86,7 @@ au BufLeave *.py call clearmatches()
-- Custom commands
vim.cmd [[
-command! MakeTagsPython !ctags --exclude=venv --languages=python --python-kinds=-i -R .
+command! MakeTagsPython !ctags --exclude=venv --exclude=.venv --languages=python --python-kinds=-i -R .
]]
-- When using tab, enter will accept the current selection and close the window
@@ -152,7 +156,7 @@ return require('packer').startup(function()
vim.api.nvim_set_keymap('n', '<leader>ps', '<cmd>source ~/.config/nvim/init.lua<cr><cmd>PackerSync<cr>', { noremap = true })
end
}
- use 'Thornycrackers-Forks/nord-vim'
+ use 'arcticicestudio/nord-vim'
use 'p00f/nvim-ts-rainbow'
use {
'nvim-treesitter/nvim-treesitter',
@@ -289,81 +293,14 @@ return require('packer').startup(function()
use 'tpope/vim-surround'
use 'tpope/vim-repeat'
use {
- 'nvim-telescope/telescope.nvim',
- requires = {
- {'nvim-lua/plenary.nvim'},
- {'glepnir/lspsaga.nvim'},
- {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
- },
+ 'junegunn/fzf.vim',
+ requires = { {'junegunn/fzf'} },
config = function()
- vim.api.nvim_set_keymap('n', '<leader>ff', "<cmd>lua require('telescope.builtin').find_files({hidden=true})<cr>", { noremap = true })
- vim.api.nvim_set_keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { noremap = true })
- vim.api.nvim_set_keymap('n', '<leader>fj', '<cmd>Telescope jumplist<cr>', { noremap = true })
- vim.api.nvim_set_keymap('n', '<leader>f/', '<cmd>Telescope live_grep<cr>', { noremap = true })
- vim.api.nvim_set_keymap('n', '<leader>fa', '<cmd>Telescope grep_string<cr>', { noremap = true })
- vim.api.nvim_set_keymap('n', '<leader>fg', "<cmd>lua require('telescope.builtin').git_status()<cr>", { noremap = true })
- vim.api.nvim_set_keymap('n', '<leader>ft', "<cmd>lua require('telescope.builtin').tags({layout_strategy='center', only_sort_tags=true, show_line=true})<cr>", { noremap = true })
- actions = require("telescope.actions")
- require("telescope").setup{
- extensions = {
- fzf = {
- fuzzy = false, -- false will only do exact matching
- override_generic_sorter = true, -- override the generic sorter
- override_file_sorter = true, -- override the file sorter
- case_mode = "smart_case", -- or "ignore_case" or "respect_case"
- -- the default case_mode is "smart_case"
- }
- },
- defaults = {
- mappings = {
- i = {
- ["<esc>"] = actions.close,
- ['<C-u>'] = false,
- },
- },
- vimgrep_arguments = {
- 'rg',
- '--color=never',
- '--no-heading',
- '--with-filename',
- '--line-number',
- '--column',
- '--smart-case'
- },
- prompt_prefix = "> ",
- selection_caret = "> ",
- entry_prefix = " ",
- initial_mode = "insert",
- selection_strategy = "reset",
- sorting_strategy = "descending",
- layout_strategy = "horizontal",
- layout_config = {
- horizontal = {
- mirror = false,
- },
- vertical = {
- mirror = false,
- },
- },
- file_sorter = require'telescope.sorters'.get_fuzzy_file,
- file_ignore_patterns = {},
- generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
- winblend = 0,
- border = {},
- borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
- color_devicons = true,
- use_less = true,
- path_display = {},
- set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
- file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
- grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
- qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
-
- -- Developer configurations: Not meant for general override
- buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
- }
- }
- require('telescope').load_extension('fzf')
+ vim.api.nvim_set_keymap('n', '<leader>ff', "<cmd>Files<cr>", { noremap = true })
+ vim.api.nvim_set_keymap('n', '<leader>fb', "<cmd>Buffers<cr>", { noremap = true })
+ vim.api.nvim_set_keymap('n', '<leader>ft', "<cmd>Tags<cr>", { noremap = true })
+ vim.api.nvim_set_keymap('n', '<leader>fm', "<cmd>Marks<cr>", { noremap = true })
+ vim.cmd([[let $FZF_DEFAULT_COMMAND = 'find . -type f -not -path "*/\.git/*" -not -path "*/\.mypy_cache/*" -not -path "*/\.venv/*" ']])
end,
}
use {
@@ -406,7 +343,9 @@ return require('packer').startup(function()
requires = { {'voldikss/vim-floaterm'} },
config = function()
vim.g.floaterm_opener = "edit"
- vim.g.lf_replace_netrw = 1;
+ vim.g.floaterm_width = 0.99
+ vim.g.floaterm_height = 0.99
+ -- vim.g.lf_replace_netrw = 1;
vim.api.nvim_set_keymap('n', '<leader>m', '<cmd>Lf<cr>', { noremap = true });
vim.api.nvim_set_keymap('n', '<leader>n', '<cmd>LfWorkingDirectory<cr>', { noremap = true});
end
@@ -421,7 +360,7 @@ return require('packer').startup(function()
require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
end
}
--- The treesitter for nix doesn't do indents
+ -- The treesitter for nix doesn't do indents
use 'LnL7/vim-nix'
use {
'dense-analysis/ale',
@@ -431,4 +370,6 @@ return require('packer').startup(function()
}
end
}
+ use 'junegunn/goyo.vim'
+ use 'hashivim/vim-terraform'
end)