From 2e84c4eb049d7d62e22d44fdf4760ed37a9059c8 Mon Sep 17 00:00:00 2001 From: pegasust Date: Tue, 22 Nov 2022 05:36:18 +0000 Subject: [PATCH] telescope: just use make instead of cmake --- home-nix/home.nix | 6 +-- neovim/init.lua | 103 ++++++++++++++++++++++++---------------------- 2 files changed, 57 insertions(+), 52 deletions(-) diff --git a/home-nix/home.nix b/home-nix/home.nix index 5d4a1bf..a713860 100644 --- a/home-nix/home.nix +++ b/home-nix/home.nix @@ -25,10 +25,10 @@ pkgs.stdenv.cc.cc.lib pkgs.yq pkgs.python39Full - pkgs.xorg.xclock - pkgs.logseq + pkgs.xorg.xclock # TODO: only include if have GL + pkgs.logseq # TODO: only include if have GL pkgs.mosh - pkgs.nixops_unstable + pkgs.nixops_unstable # nixops v2 # pkgs.python310 # dev packages should be in jk # pkgs.python310.numpy # pkgs.python310Packages.tensorflow diff --git a/neovim/init.lua b/neovim/init.lua index d2fb267..cad03c0 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -1,4 +1,3 @@ -vim.lsp.set_log_level("debug") -- What: Mono-file nvim configuration file -- Why: Easy to see through everything without needing to navigate thru files -- Features: @@ -11,61 +10,19 @@ vim.lsp.set_log_level("debug") -- - zk @ https://github.com/mickael-menu/zk -- - prettierd @ npm install -g @fsouza/prettierd --- Basic settings of vim -vim.cmd([[ -set number relativenumber -set tabstop=4 softtabstop=4 -set expandtab -set shiftwidth=4 -set smartindent -set exrc -set incsearch -set scrolloff=30 -set signcolumn=yes -set colorcolumn=80 -set background=light -]]) -vim.opt.lazyredraw = true -vim.opt.termguicolors = true -vim.opt.cursorline = true --- some plugins misbehave when we do swap files -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true -vim.opt.completeopt = 'menuone,noselect' --- vim.opt.clipboard = "unnamedplus" - -vim.g.mapleader = ' ' -vim.g.maplocalleader = ',' - --- basic keymaps -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- since we're using space for leader -vim.keymap.set('t', '', ')') -- make :terminal escape out -vim.keymap.set({ 'n', 'i', 'v' }, '', ':mode') -- redraw on every mode - --- diagnostics (errors/warnings to be shown) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next) -vim.keymap.set('n', 'e', vim.diagnostic.open_float) -- opens diag in box (floating) --- vim.keymap.set('n', 'q', vim.diagnostic.setloclist) -- opens list of diags --- vim.keymap.set('n', 'wq', vim.diagnostic.setqflist) -- workspace diags -vim.keymap.set('n', 'q', 'TroubleToggle loclist') -vim.keymap.set('n', 'wq', 'TroubleToggle workspace_diagnostics') - - -- vim-plug local data_dir = vim.fn.stdpath('data') vim.cmd([[ let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +autocmd VimEnter * PlugInstall --sync | source $MYVIMRC if empty(glob(data_dir . '/autoload/plug.vim')) silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' endif - -autocmd VimEnter * PlugInstall --sync | source $MYVIMRC ]]) local Plug = vim.fn['plug#'] + +-- TODO: Change this to relative datadir vim.call('plug#begin', '~/.config/nvim/plugged') -- libs and dependencies @@ -75,9 +32,9 @@ Plug('nvim-lua/plenary.nvim') Plug('tjdevries/nlua.nvim') -- adds symbols of vim stuffs in init.lua Plug('nvim-treesitter/nvim-treesitter') -- language parser engine for highlighting Plug('nvim-treesitter/nvim-treesitter-textobjects') -- more text objects -Plug('nvim-telescope/telescope.nvim', { tag = '0.1.0' }) -- file browser +Plug('nvim-telescope/telescope.nvim', { branch = '0.1.x' }) -- file browser Plug('nvim-telescope/telescope-fzf-native.nvim', - { ['do'] = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=release && cmake --build build --config Release && cmake --install build --prefix build' }) + { ['do'] = 'make >> /tmp/log 2>&1' }) Plug('nvim-telescope/telescope-file-browser.nvim') -- cmp: auto-complete/suggestions @@ -130,8 +87,54 @@ Plug('mickael-menu/zk-nvim') -- Zettelkasten --------- vim.call('plug#end') +if vim.v.vim_did_enter then + +vim.cmd([[ +set number relativenumber +set tabstop=4 softtabstop=4 +set expandtab +set shiftwidth=4 +set smartindent +set exrc +set incsearch +set scrolloff=30 +set signcolumn=yes +set colorcolumn=80 +set background=light + +]]) +vim.opt.lazyredraw = true +vim.opt.termguicolors = true +vim.opt.cursorline = true +-- some plugins misbehave when we do swap files +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true +vim.opt.completeopt = 'menuone,noselect' +-- vim.opt.clipboard = "unnamedplus" + +vim.g.mapleader = ' ' +vim.g.maplocalleader = ',' + +-- basic keymaps +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- since we're using space for leader +vim.keymap.set('t', '', ')') -- make :terminal escape out +vim.keymap.set({ 'n', 'i', 'v' }, '', ':mode') -- redraw on every mode + +-- diagnostics (errors/warnings to be shown) +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next) +vim.keymap.set('n', 'e', vim.diagnostic.open_float) -- opens diag in box (floating) +-- vim.keymap.set('n', 'q', vim.diagnostic.setloclist) -- opens list of diags +-- vim.keymap.set('n', 'wq', vim.diagnostic.setqflist) -- workspace diags +vim.keymap.set('n', 'q', 'TroubleToggle loclist') +vim.keymap.set('n', 'wq', 'TroubleToggle workspace_diagnostics') + -- color, highlighting, UI stuffs -vim.cmd([[ colorscheme gruvbox ]]) +vim.cmd([[ +colorscheme gruvbox +]]) require('hlargs').setup() require('nvim-web-devicons').setup() require('trouble').setup() @@ -885,3 +888,5 @@ require('nvim-surround').setup {} vim.cmd([[ let g:conjure#mapping#doc_word = v:false ]]) + +end