English 中文(简体)
最有效的方式是把吉特·詹戈环境存档于维姆
原标题:Most efficient way to edit Django settings file in Vim

最有效的方式(即,最少的重力)是把在维姆的Django环境档案用于使用Qalite?

仅凭空景:

# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ( Your Name ,  [email protected] ),
)

MANAGERS = ADMINS

DATABASES = {
     default : {
         ENGINE :  django.db.backends. , # Add  postgresql_psycopg2 ,  mysql ,  sqlite3  or  oracle .
         NAME :   ,                      # Or path to database file if using sqlite3.
         USER :   ,                      # Not used with sqlite3.
         PASSWORD :   ,                  # Not used with sqlite3.
         HOST :   ,                      # Set to empty string for localhost. Not used with sqlite3.
         PORT :   ,                      # Set to empty string for default. Not used with sqlite3.
    }
}
...

...and I want it to look like this:

# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ( Your Name ,  [email protected] ),
)

MANAGERS = ADMINS

DATABASES = {
     default : {
         ENGINE :  django.db.backends.sqlite3 , # Add  postgresql_psycopg2 ,  mysql ,  sqlite3  or  oracle .
         NAME :  local.db ,                      # Or path to database file if using sqlite3.
         USER :   ,                      # Not used with sqlite3.
         PASSWORD :   ,                  # Not used with sqlite3.
         HOST :   ,                      # Set to empty string for localhost. Not used with sqlite3.
         PORT :   ,                      # Set to empty string for default. Not used with sqlite3.
    }
}
...

I know this is a trivial question, but I m trying to get more efficient with Vim, so I m curious if others have quicker approaches to this repetitive task.

最佳回答

I m sure this won t win Vim Golf, but here s how I d do it. Starting in normal mode:

:%s/backends./backends.sqlite3/ <Enter>
/NAME <Enter>
2f 
i local.db

这就是:寻找支持。 通过整个缓冲,将一审改为后。 之后,寻求非农产品市场准入,将 cur子移至发现的初审。 然后,就第二例(引文)的发生向目前线查询。 插入方式。 当地类型b

<>Update>

为了最大限度地提高效率和利用评论意见中的建议,此处略为缩短案文,仍然采用同样的方法:

:%s/ends./&sqlite3/ <Enter>
/NAM <Enter>
2f 
i local.db

我将使用<代码>/NA,直到我注意到中东和北非区域局在不结盟运动之前显示。 Vim 这种办法的得分:38。

问题回答

暂无回答




相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签