Skip to content

Commit

Permalink
Default.
Browse files Browse the repository at this point in the history
  • Loading branch information
takkii committed Jan 15, 2025
0 parents commit 6f6f0a9
Show file tree
Hide file tree
Showing 6 changed files with 335 additions and 0 deletions.
192 changes: 192 additions & 0 deletions .gvimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
" Settings
let g:python3_host_prog=$HOME . '/scoop/apps/python311/current/python.exe'

"LightLine
let g:lightline = {
\ 'colorscheme': 'icebergDark',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified' ],
\ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok' ] ],
\ },
\ }

let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ }
let g:lightline.component_type = {
\ 'linter_checking': 'left',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'left',
\ }
let b:ale_linters = {
\ 'javascript': ['eslint', 'eslint-plugin-vue'],
\ 'python': ['pyflakes', 'pep8'],
\ 'ruby': ['rubocop'],
\ 'tex': ['textlint'],
\ 'markdown': ['textlint'],
\ 'css': ['stylelint'],
\}
let g:ale_statusline_format = ['E%d', 'W%d', 'ok']
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
nmap <silent> <C-n> <Plug>(ale_next_wrap)
" Defx
autocmd FileType defx call s:defx_my_settings()
function! s:defx_my_settings() abort
" Define mappings
nnoremap <silent><buffer><expr> <CR>
\ defx#do_action('open')
nnoremap <silent><buffer><expr> c
\ defx#do_action('copy')
nnoremap <silent><buffer><expr> m
\ defx#do_action('move')
nnoremap <silent><buffer><expr> p
\ defx#do_action('paste')
nnoremap <silent><buffer><expr> l
\ defx#do_action('open')
nnoremap <silent><buffer><expr> E
\ defx#do_action('open', 'vsplit')
nnoremap <silent><buffer><expr> P
\ defx#do_action('open', 'pedit')
nnoremap <silent><buffer><expr> o
\ defx#do_action('open_or_close_tree')
nnoremap <silent><buffer><expr> K
\ defx#do_action('new_directory')
nnoremap <silent><buffer><expr> N
\ defx#do_action('new_file')
nnoremap <silent><buffer><expr> M
\ defx#do_action('new_multiple_files')
nnoremap <silent><buffer><expr> C
\ defx#do_action('toggle_columns',
\ 'mark:indent:icon:filename:type:size:time')
nnoremap <silent><buffer><expr> S
\ defx#do_action('toggle_sort', 'time')
nnoremap <silent><buffer><expr> d
\ defx#do_action('remove')
nnoremap <silent><buffer><expr> r
\ defx#do_action('rename')
nnoremap <silent><buffer><expr> !
\ defx#do_action('execute_command')
nnoremap <silent><buffer><expr> x
\ defx#do_action('execute_system')
nnoremap <silent><buffer><expr> yy
\ defx#do_action('yank_path')
nnoremap <silent><buffer><expr> .
\ defx#do_action('toggle_ignored_files')
nnoremap <silent><buffer><expr> ;
\ defx#do_action('repeat')
nnoremap <silent><buffer><expr> h
\ defx#do_action('cd', ['..'])
nnoremap <silent><buffer><expr> ~
\ defx#do_action('cd')
nnoremap <silent><buffer><expr> q
\ defx#do_action('quit')
nnoremap <silent><buffer><expr> <Space>
\ defx#do_action('toggle_select') . 'j'
nnoremap <silent><buffer><expr> *
\ defx#do_action('toggle_select_all')
nnoremap <silent><buffer><expr> j
\ line('.') == line('$') ? 'gg' : 'j'
nnoremap <silent><buffer><expr> k
\ line('.') == 1 ? 'G' : 'k'
nnoremap <silent><buffer><expr> <C-l>
\ defx#do_action('redraw')
nnoremap <silent><buffer><expr> <C-g>
\ defx#do_action('print')
nnoremap <silent><buffer><expr> cd
\ defx#do_action('change_vim_cwd')
endfunction

" Denite
nnoremap <silent> <space>fr :<C-u>Denite file_mru -split="floating"<CR>
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent> <space>
\ fr :<C-u>Denite file_mru -split="floating"<CR>
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> d
\ denite#do_map('do_action', 'delete')
nnoremap <silent><buffer><expr> p
\ denite#do_map('do_action', 'preview')
nnoremap <silent><buffer><expr> q
\ denite#do_map('quit')
nnoremap <silent><buffer><expr> i
\ denite#do_map('open_filter_buffer')
nnoremap <silent><buffer><expr> <Space>
\ denite#do_map('toggle_select').'j'
endfunction

autocmd FileType denite-filter call s:denite_filter_my_setting()
function! s:denite_filter_my_setting() abort
inoremap <silent><buffer><expr> <BS> denite#do_map('move_up_path')
inoremap <silent><buffer><expr> <C-c> denite#do_map('quit')
nnoremap <silent><buffer><expr> <C-c> denite#do_map('quit')
endfunction

" vim-com
if filereadable(expand('~/.vim/plugged/vim-com/plugins/refac.vim'))
source ~/.vim/plugged/vim-com/plugins/refac.vim
endif

" Settings
source $VIMRUNTIME\delmenu.vim
set langmenu=ja_jp.utf-8
source $VIMRUNTIME\menu.vim

if exists('b:did_ftplugin_python')
finish
endif
let b:did_ftplugin_python = 1

if version < 600
syntax clear
elseif exists('b:current_after_syntax')
finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn match pythonOperator "\(+\|=\|-\|\^\|\*\)"
syn match pythonDelimiter "\(,\|\.\|:\)"
syn keyword pythonSpecialWord self

hi link pythonSpecialWord Special
hi link pythonDelimiter Special

let b:current_after_syntax = 'python'

let &cpo = s:cpo_save
unlet s:cpo_save

set guioptions-=T
set lines=42
set columns=135
set encoding=utf-8

set fileencodings=utf-8,cp932
set background=dark
colorscheme iceberg
set splitbelow
set nobackup
set noundofile
set noswapfile
syntax enable
set number
set wildmenu
set wildmode=list:full
set laststatus=2
set guifont=HackGen_Console_NF:h11:cANSI:qDRAFT
set backspace=indent,eol,start
source $VIMRUNTIME/mswin.vim

" $HOME
cd ~
47 changes: 47 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

if has('nvim')
Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/defx.nvim'
Plug 'Shougo/denite.nvim'
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif

" Deoplete Plugins.
Plug 'deoplete-plugins/deoplete-jedi'

" My Plugins, maked by takkii.
Plug 'takkii/overlap'
Plug 'takkii/kindness'
Plug 'takkii/vim-com'

" appearance
Plug 'itchyny/lightline.vim'
Plug 'maximbaz/lightline-ale'
Plug 'dense-analysis/ale'
Plug 'gkeep/iceberg-dark'
Plug 'cocopon/iceberg.vim'

" Initialize plugin system
call plug#end()

" Deoplete
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'auto_complete_delay': 0,
\ 'smart_case': v:true,
\ 'max_list': 30,
\ })

inoremap <expr><tab> pumvisible() ? "\<C-n>" :
\ neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<tab>"
28 changes: 28 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
The MIT License

Copyright (c) 2025 Takayuki Kamiyama

Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and
associated documentation files (the [Software]),
to deal in the Software without restriction,
including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense,
and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and
this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED [AS IS],
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Windows / Vim
```markdown
# how to use.
scoop install vim
```
30 changes: 30 additions & 0 deletions delete.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

require 'open3'
require 'fileutils'

# Delete runner.
class DeleteRunner
# default encoding utf-8, change encode here.
def self.encoding_style
Encoding.default_internal = 'UTF-8'
Encoding.default_external = 'UTF-8'
end

def self.run
encoding_style
FileUtils.rm_rf(File.expand_path('~/.vimrc'))
FileUtils.rm_rf(File.expand_path('~/.gvimrc'))
puts 'Deleted, .vimrc and .gvimrc file.'
end
end

begin
DeleteRunner.run
rescue StandardError => e
puts e.backtrace
ensure
GC.compact
end

__END__
33 changes: 33 additions & 0 deletions win_install.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true
#!/usr/bin/ruby

class Dark
def self.matter
myhome = File.expand_path('~/.vimrc')
File.open(myhome, 'a:utf-8', perm = 0o777) do |f|
f.puts <<-DOC
" deoplete.nvim.
if filereadable(expand('~/GitHub/winvim/.vimrc'))
source ~/GitHub/winvim/.vimrc
endif
DOC
end
puts ".vimrc has been created and configured."
end

def self.power
myhome = File.expand_path('~/.gvimrc')
File.open(myhome, 'a:utf-8', perm = 0o777) do |f|
f.puts <<-DOC
" deoplete.nvim.
if filereadable(expand('~/GitHub/winvim/.gvimrc'))
source ~/GitHub/winvim/.gvimrc
endif
DOC
end
puts ".gvimrc has been created and configured."
end
end

Dark.matter
Dark.power

0 comments on commit 6f6f0a9

Please sign in to comment.