nix format doesn't like tabs

This commit is contained in:
Anish L 2022-03-17 00:56:53 +10:00
parent 779a0243d6
commit 49d9907b32

View file

@ -34,7 +34,7 @@ let
];
python-with-my-packages = pkgs.python3.withPackages my-python-packages;
in
{
{
environment.variables.EDITOR = "nvim";
environment.shellAliases = {
k = "cd ~/vimwiki; vim -c :VimwikiIndex";
@ -49,7 +49,7 @@ in
vale
clj-kondo
# Other LSPs or linters
( neovim.override {
(neovim.override {
vimAlias = true;
withPython3 = true;
extraPython3Packages = pkgs: with pkgs; [ tasklib six ];
@ -171,6 +171,7 @@ in
" tabs
nmap <leader>rt :retab!<CR>
vmap <leader>rt :retab!<CR>
let mapleader = "\<Space>"
let maplocalleader = ","
@ -256,6 +257,9 @@ in
nmap <leader>gl :diffget //2
nmap <leader>gc :GBranches<CR>
nnoremap <leader>gp :Git! push<CR>
nnoremap <leader>gd :Gdiff<CR>
nnoremap <space>gt :Gcommit -v -q %:p<CR>
nnoremap <Leader>gb :Gblame<CR>
" kitaab
map <leader>zs :ZettelSearch<CR>
@ -269,13 +273,13 @@ in
nmap <Leader>sl :<C-u>SessionLoad<CR>
nnoremap <silent> <Leader>fh :DashboardFindHistory<CR>
nnoremap <silent> <Leader>ff :DashboardFindFile<CR>
nnoremap <silent> <Leader>fa :DashboardFindWord<CR>
nnoremap <silent> <Leader>fm :DashboardJumpMark<CR>
nnoremap <silent> <Leader>cn :DashboardNewFile<CR>
nnoremap <silent> <Leader>tn :tabnew<CR>
autocmd FileType dashboard set showtabline=0 | autocmd WinLeave <buffer> set showtabline=2
" fzf
" not sure we even use this
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } }
" lsp commands
@ -286,33 +290,33 @@ in
nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR>
nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR>
nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR>
nnoremap <leader>vsd :lua vim.lsp.diagnostic.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics()<CR>
nnoremap <leader>vsd :lua rim.lsp.diagnostic.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics()<CR>
nnoremap <leader>vn :lua vim.lsp.diagnostic.goto_next()<CR>
nnoremap <leader>vll :call LspLocationList()<CR>
nnoremap <leader>va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor())<cr>
" lua config
lua <<EOF
-- autopairs
require('nvim-autopairs').setup{}
-- autopairs
require('nvim-autopairs').setup{}
-- Setup nvim-cmp.
local has_words_before = function()
-- Setup nvim-cmp.
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
end
local luasnip = require("luasnip")
local cmp = require('cmp')
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local t = function(str)
local luasnip = require("luasnip")
local cmp = require('cmp')
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
local check_back_space = function()
end
local check_back_space = function()
local col = vim.fn.col(".") - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil
end
cmp.setup {
end
cmp.setup {
formatting = {
format = function(entry, vim_item)
-- fancy icons and a name of kind
@ -370,30 +374,30 @@ cmp.setup {
{name = 'cmp-conjure'}
},
completion = {completeopt = 'menu,menuone,noinsert'}
}
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = ' ' } }))
-- TabNine cmp
local tabnine = require('cmp_tabnine.config')
tabnine:setup({max_lines = 1000, max_num_results = 20, sort = true})
}
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = ' ' } }))
-- TabNine cmp
local tabnine = require('cmp_tabnine.config')
tabnine:setup({max_lines = 1000, max_num_results = 20, sort = true})
-- Setup lspconfig
require("lsp-format").setup {}
-- Setup lspconfig
require("lsp-format").setup {}
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
require('lspconfig').clojure_lsp.setup {on_attach = require "lsp-format".on_attach}
require('lspconfig').rnix.setup {on_attach = require "lsp-format".on_attach}
require('lspconfig').pylsp.setup {on_attach = require "lsp-format".on_attach}
require('lspconfig').terraform_lsp.setup {on_attach = require "lsp-format".on_attach}
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
require('lspconfig').clojure_lsp.setup {on_attach = require "lsp-format".on_attach}
require('lspconfig').rnix.setup {on_attach = require "lsp-format".on_attach}
require('lspconfig').pylsp.setup {on_attach = require "lsp-format".on_attach}
require('lspconfig').terraform_lsp.setup {on_attach = require "lsp-format".on_attach}
require('gitsigns').setup { sign_priority=80 }
require('gitsigns').setup { sign_priority=80 }
-- treesitter
require('nvim-treesitter.configs').setup { ensure_installed={'nix', 'clojure', 'python', 'typescript'}}
-- treesitter
require('nvim-treesitter.configs').setup { ensure_installed={'nix', 'clojure', 'python', 'typescript'}}
-- lualine
require('nvim-gps').setup {}
local gps = require('nvim-gps')
require('lualine').setup {
-- lualine
require('nvim-gps').setup {}
local gps = require('nvim-gps')
require('lualine').setup {
sections = {
lualine_c = {
'filename', { gps.get_location, condition=gps.is_available },
@ -416,23 +420,22 @@ require('lualine').setup {
end
},
}
}
}
-- nvim-lint
require('lint').linters_by_ft = {
-- nvim-lint
require('lint').linters_by_ft = {
markdown = {'vale'},
clojure = {'clj-kondo'},
python = {'black'}
}
}
-- f_term
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
map('n', '<C-i>', '<CMD>lua require("FTerm").toggle()<CR>', opts)
map('t', '<A-i>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>', opts)
EOF
-- f_term
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
map('n', '<C-i>', '<CMD>lua require("FTerm").toggle()<CR>', opts)
map('t', '<A-i>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>', opts)
EOF
'';
};
}
)];
)
];
}